forked from guaj/covidtrackingapp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
3,567 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
{ | ||
"chromeWebSecurity": false | ||
} | ||
"chromeWebSecurity": false | ||
"viewportWidth": 1000, | ||
"viewportHeight": 1000 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//test 1 | ||
describe('Users QRcode can be accessed form user profile', () => { | ||
it('QRcode is visible on user profile', () => { | ||
cy.visit("http://localhost:3000/") //open browser to localhost: 3000 | ||
cy.findByRole('textbox', { name: /[email protected]/i }).clear() // clear field | ||
cy.findByRole('textbox', { name: /[email protected]/i }).type('[email protected]')// select email field and enter email : [email protected] | ||
cy.findByTestId('sign-up-password').clear() | ||
cy.findByTestId('sign-up-password').type('Patient1!')// select password field and enter password : Patient1! | ||
cy.findByText(/login/i).click()// click on login | ||
cy.wait(2000) //for the db to update page | ||
cy.findByRole('button', { name: /account of current user/i}).click() | ||
cy.findByTestId('profile-button').click() // click profile button | ||
cy.wait(2000) //for the db to update page | ||
cy.findByTestId('QRcode') //Confirm QRcode exists | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "Using fixtures to represent data", | ||
"email": "[email protected]", | ||
"body": "Fixtures are a great way to mock data for responses to routes" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
describe('As an admin, I want to be able to search a patient by their Last Name', () => { | ||
it('An admin can access the patients profile through the search bar by typing their Last Name', () => { | ||
cy.visit('http://localhost:3000/'); | ||
cy.findByRole('textbox', { name: /this\.example@email\.com/i }).clear().type('[email protected]')// select email field and enter email : [email protected]' | ||
cy.findByTestId('sign-up-password').clear().type('Admin1234!')// select password field and enter password : Admin1234! | ||
cy.findByText(/login/i).click()// click on login | ||
cy.findByRole('textbox', {name: /search/i }).click()//click on the search bar of the dashboard | ||
cy.findByRole('textbox', { name: /search/i }).type('snow')//type letters to the patient you are trying to search | ||
cy.findByRole('link', { name: /mike snow \[ktl@hotmail\.com\]/i }).click()// select the right patient name and redirect to patient profile | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
describe('As a patient, I want to be able to contact my doctor', () => { | ||
|
||
it('A patient can access the contact my doctor button', () => { | ||
cy.visit('http://localhost:3000/'); | ||
cy.findByRole('textbox', { name: /this\.example@email\.com/i }).type('[email protected]')// select email field and enter email : [email protected] | ||
cy.findByTestId('sign-up-password').type('Patient1!')// select passeword field and enter password : Patient1! | ||
cy.findByText(/login/i).click()// click on login | ||
cy.findByRole('button', { name: /account of current user/i }).click() // click on profile icon | ||
cy.findByRole('menuitem', { name: /profile/i }).click()// click on profile link | ||
cy.findByText(/contact my doctor/i).click() | ||
}) | ||
|
||
it('A patient can fill a form to be sent to his doctor via email', () => { | ||
cy.findByRole('textbox', {name: /full name/i}).type('Test name') | ||
cy.findByRole('textbox', { name: /subject/i }).type("Test subject") | ||
cy.findByRole('textbox', { name: /message/i }).type('This is a test message') | ||
}) | ||
|
||
it('A email can send the form filled to his doctor email', () => { | ||
cy.findByText(/submit/i).click() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
describe('Patient can schedule an appointment from his doctor availabilities', () => { | ||
|
||
beforeEach(() => { | ||
cy.visit('http://localhost:3000/'); | ||
}); | ||
|
||
afterEach( () => { | ||
cy.findByRole('button', { name: /account of current user/i }).click() | ||
cy.findByRole('menuitem', { name: /logout/i }).click() | ||
}) | ||
|
||
it('As a patient, i can see the scheduling availabilities for an appointment with my doctor and pick an appointment', () => { | ||
cy.findByRole('textbox', { name: /this\.example@email\.com/i }).type('[email protected]')// select email field and enter email : [email protected] | ||
cy.findByTestId('sign-up-password').type('Patient1!')// select passeword field and enter password : Patient1! | ||
cy.findByText(/login/i).click()// click on login | ||
cy.findByRole('button', { name: /account of current user/i }).click() // click on profile icon | ||
cy.findByRole('menuitem', { name: /profile/i }).click()// click on profile link | ||
cy.findByText(/make appointment/i).click() | ||
cy.findByRole('button', { name: /calendar view is open, go to text input view/i }).click() | ||
cy.findByRole('textbox').clear() | ||
cy.findByRole('textbox').type('04032025') | ||
cy.findByText(/19:00:00/i).click()// click on 19:00:00 | ||
cy.findByText(/19:00:00/i).click() | ||
cy.findByRole('button', { name: /select appointment/i }).click()// click on select appointment | ||
}) | ||
|
||
it('As a doctor, I can interact with a schedule selector and save my availabilities', () => { | ||
cy.findByRole('textbox', { name: /this\.example@email\.com/i }).type('[email protected]')// select email field and enter email : [email protected] | ||
cy.findByTestId('sign-up-password').type('doctorpass2')// select passeword field and enter password : Patient1! | ||
cy.findByText(/login/i).click()// click on login | ||
cy.findByRole('tab', { name: /my availabilities/i}).click() | ||
cy.get('#simple-tabpanel-2 > div > p > div > div > div:nth-child(1) > div > div:nth-child(3) > div:nth-child(4) > div').click() | ||
cy.findByRole('button', { name: /save/i }).click() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
describe('As a doctor , I want to be able to search a patient by their email', () => { | ||
it('A doctor can access the patients profile through the search bar by typing their patients email', () => { | ||
cy.visit('http://localhost:3000/'); | ||
cy.findByRole('textbox', { name: /this\.example@email\.com/i }).clear().type('[email protected]')// select email field and enter email : [email protected] | ||
cy.findByTestId('sign-up-password').clear().type('doctorpass2')// select password field and enter password : doctorpass2 | ||
cy.findByText(/login/i).click()// click on login | ||
cy.findByRole('textbox', {name: /search/i }).click()//click on the search bar of the dashboard | ||
cy.findByRole('textbox', { name: /search/i }).type('ktl')//type letters to the patient you are trying to search | ||
cy.findByRole('link', { name: /mike snow \[ktl@hotmail\.com\]/i }).click()// select the right patient name and redirect to patient profile | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
describe('As an admin, I want to be able to search a patient by their Name', () => { | ||
it('An admin can access the patients profile through the search bar by typing their Last Name', () => { | ||
cy.visit('http://localhost:3000/'); | ||
cy.findByRole('textbox', { name: /this\.example@email\.com/i }).clear().type('[email protected]')// select email field and enter email : [email protected]' | ||
cy.findByTestId('sign-up-password').clear().type('Admin1234!')// select password field and enter password : Admin1234! | ||
cy.findByText(/login/i).click()// click on login | ||
cy.findByRole('textbox', {name: /search/i }).click()//click on the search bar of the dashboard | ||
cy.findByRole('textbox', { name: /search/i }).type('mike')//type a letters to the patient you are trying to search | ||
cy.findByRole('link', { name: /mike snow \[ktl@hotmail\.com\]/i }).click()// select the right patient name and redirect to patient profile | ||
}) | ||
}) |
Oops, something went wrong.