-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #537 from chaynHQ/develop
Merge Develop onto Main
- Loading branch information
Showing
6 changed files
with
80 additions
and
7 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
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
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
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,51 @@ | ||
describe('A logged in user should be able to navigate to a course session and complete it', () => { | ||
const newUserEmail = `cypresstestemail+${Date.now()}@chayn.co`; | ||
const password = 'testpassword'; | ||
|
||
before(() => { | ||
cy.cleanUpTestState(); | ||
|
||
cy.createUser({ | ||
//create test user | ||
emailInput: newUserEmail, | ||
passwordInput: password, | ||
}); | ||
}); | ||
|
||
it('Should go to courses page and select a course & session', () => { | ||
cy.logInWithEmailAndPassword(newUserEmail, password); //log in to test user | ||
|
||
cy.get(`[qa-id=secondary-nav-courses-button]`).should('exist').click(); //navigate to courses | ||
|
||
cy.get('a[href*="healing-from-sexual-trauma"]', { | ||
timeout: 4000, | ||
}) | ||
.first() | ||
.click(); //click on a course when link load | ||
|
||
// cy.getIframeBody().find('button').click(); Attempting to watch the session video. iframe isnt working at the moment | ||
|
||
cy.get('a[href*="what-is-sexual-trauma"]', { | ||
timeout: 4000, | ||
}) | ||
.first() | ||
.click(); //click on a session when link loads | ||
}); | ||
|
||
it('Should read activity & bonus content and complete session', () => { | ||
cy.visit('/courses/healing-from-sexual-trauma/what-is-sexual-trauma'); | ||
cy.wait(5000); | ||
|
||
cy.get('h3').contains('Activity').click(); //open activities | ||
|
||
cy.get('h3').contains('Bonus content').click(); //open bonus content | ||
|
||
cy.get('button').contains('Session complete').click(); //mark course as complete | ||
|
||
cy.deleteUser(); //delete test user | ||
}); | ||
|
||
after(() => { | ||
cy.logout(); | ||
}); | ||
}); |
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
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