Skip to content

Commit

Permalink
prfileEdit resolved conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
EyalAzimov committed Apr 7, 2022
2 parents 6e9e922 + d0dd872 commit 5ddb927
Show file tree
Hide file tree
Showing 40 changed files with 3,567 additions and 80 deletions.
6 changes: 4 additions & 2 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"chromeWebSecurity": false
}
"chromeWebSecurity": false
"viewportWidth": 1000,
"viewportHeight": 1000
}
16 changes: 16 additions & 0 deletions cypress/Integration/QRcode_Test.js
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
})
})
5 changes: 5 additions & 0 deletions cypress/fixtures/example.json
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"
}
11 changes: 11 additions & 0 deletions cypress/integration/PatientSearchLastName_spec.js
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
})
})
22 changes: 22 additions & 0 deletions cypress/integration/contact-doctor_spec.js
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()
})
})
35 changes: 35 additions & 0 deletions cypress/integration/doctor-appointment-scheduling_spec.js
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()
})
})
11 changes: 11 additions & 0 deletions cypress/integration/patientSearchEmail_spec.js
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
})
})
11 changes: 11 additions & 0 deletions cypress/integration/patientSearchName_spec.js
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
})
})
Loading

0 comments on commit 5ddb927

Please sign in to comment.