diff --git a/.github/workflows/cypress-tests.yml b/.github/workflows/cypress-tests.yml index cd52e5c8..5f0492fa 100644 --- a/.github/workflows/cypress-tests.yml +++ b/.github/workflows/cypress-tests.yml @@ -20,7 +20,7 @@ jobs: - name: Run tests run: | - npx cypress run --config projectId=$CYPRESS_PROJECT_ID --record --key $CYPRESS_RECORD_KEY --env baseUrl='https://dev.firstvoices.com/',CYPRESS_DIALECT='lilwat',CYPRESS_FV_USERNAME=${{secrets.CYPRESS_FV_USERNAME}},CYPRESS_FV_PASSWORD=${{secrets.CYPRESS_FV_PASSWORD}},CYPRESS_FV_INITIALS=${{secrets.CYPRESS_FV_INITIALS}},CYPRESS_ORIGIN=${{secrets.CYPRESS_ORIGIN}},retries=2 -s "cypress/e2e/core_suite_master.cy.js" + npx cypress run --config projectId=$CYPRESS_PROJECT_ID --record --key $CYPRESS_RECORD_KEY --env baseUrl='https://dev.firstvoices.com/',DIALECT='lilwat',CYPRESS_FV_USERNAME=${{secrets.CYPRESS_FV_USERNAME}},CYPRESS_FV_PASSWORD=${{secrets.CYPRESS_FV_PASSWORD}},CYPRESS_FV_INITIALS=${{secrets.CYPRESS_FV_INITIALS}},CYPRESS_ORIGIN=${{secrets.CYPRESS_ORIGIN}},retries=2 -s "cypress/e2e/core_suite_master.cy.js" env: baseUrl: 'https://dev.firstvoices.com/' CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} @@ -28,4 +28,3 @@ jobs: CYPRESS_FV_USERNAME: ${{ secrets.CYPRESS_FV_USERNAME }} CYPRESS_FV_PASSWORD: ${{ secrets.CYPRESS_FV_PASSWORD }} CYPRESS_FV_INITIALS: ${{ secrets.CYPRESS_FV_INITIALS }} - CYPRESS_DIALECT: ${{ secrets.CYPRESS_DIALECT }} diff --git a/cypress/e2e/dashboard/pages.cy.js b/cypress/e2e/dashboard/pages.cy.js index 45daa499..ce97bbb9 100644 --- a/cypress/e2e/dashboard/pages.cy.js +++ b/cypress/e2e/dashboard/pages.cy.js @@ -10,6 +10,12 @@ describe( () => { beforeEach(() => { cy.viewport(1024, 768) + }) + + it('4.1 - custom page', () => { + const site = `${Cypress.env('baseUrl')}${Cypress.env( + 'DIALECT', + )}/custom/qacustompage` cy.visit(`${Cypress.env('baseUrl')}`) cy.contains('Sign in').click() cy.origin(`${Cypress.env('CYPRESS_ORIGIN')}`, () => { @@ -26,12 +32,6 @@ describe( Cypress.env('CYPRESS_FV_PASSWORD'), ) }) - }) - - it('4.1 - custom page', () => { - const site = `${Cypress.env('baseUrl')}${Cypress.env( - 'CYPRESS_DIALECT', - )}/custom/qacustompage` cy.contains('Explore Languages').should('be.visible') cy.visit(site) @@ -43,6 +43,22 @@ describe( }) it('3.1 edit homepage', () => { + cy.visit(`${Cypress.env('baseUrl')}`) + cy.contains('Sign in').click() + cy.origin(`${Cypress.env('CYPRESS_ORIGIN')}`, () => { + Cypress.Commands.add('login', (email, password) => { + cy.get('#signInFormUsername').type(email, { force: true }) + // lets try an incorrect password + cy.get('#signInFormPassword').type(`${password}{enter}`, { + force: true, + }) + }) + + cy.login( + Cypress.env('CYPRESS_FV_USERNAME'), + Cypress.env('CYPRESS_FV_PASSWORD'), + ) + }) cy.contains('Explore Languages').click() cy.contains(`${Cypress.env('CYPRESS_FV_INITIALS')}`).click() cy.contains('Dashboard').click() @@ -52,6 +68,24 @@ describe( }) it('12.2 - Page Text', () => { + cy.visit(`${Cypress.env('baseUrl')}`) + cy.contains('Sign in').click() + cy.origin(`${Cypress.env('CYPRESS_ORIGIN')}`, () => { + Cypress.Commands.add('login', (email, password) => { + cy.on('uncaught:exception', () => false) + + cy.get('#signInFormUsername').type(email, { force: true }) + // lets try an incorrect password + cy.get('#signInFormPassword').type(`${password}{enter}`, { + force: true, + }) + }) + + cy.login( + Cypress.env('CYPRESS_FV_USERNAME'), + Cypress.env('CYPRESS_FV_PASSWORD'), + ) + }) cy.contains('Explore Languages').click() cy.contains(`${Cypress.env('CYPRESS_FV_INITIALS')}`).click() cy.contains('Dashboard').click() diff --git a/cypress/e2e/dashboard/speaker.cy.js b/cypress/e2e/dashboard/speaker.cy.js index 10d62603..cb030323 100644 --- a/cypress/e2e/dashboard/speaker.cy.js +++ b/cypress/e2e/dashboard/speaker.cy.js @@ -31,7 +31,7 @@ describe( cy.contains('Explore Languages').click() }) it('Create Speaker', () => { - cy.visit(`${Cypress.env('baseUrl')}${Cypress.env('CYPRESS_DIALECT')}`) + cy.visit(`${Cypress.env('baseUrl')}${Cypress.env('DIALECT')}`) cy.contains(`${Cypress.env('CYPRESS_FV_INITIALS')}`).click() cy.contains('Dashboard').click() cy.contains('Create').click() @@ -64,7 +64,10 @@ describe( cy.contains('Dashboard').click() cy.contains('Edit').click() cy.contains('Edit speakers').click() - cy.get('[data-testid="edit-speaker-qatestspeaker"]').eq(0).click() + cy.get('[data-testid="edit-speaker-qatestspeaker"]').click() + cy.get('#bio') + .invoke('val') + .then((sometext) => sometext === 'this is the new value') cy.contains('Delete Speaker').click() cy.get('[data-testid="DeleteModal"]').contains('Delete').click() }) diff --git a/cypress/e2e/songs.cy.js b/cypress/e2e/songs.cy.js index 6a054e74..b03ec672 100644 --- a/cypress/e2e/songs.cy.js +++ b/cypress/e2e/songs.cy.js @@ -29,7 +29,7 @@ describe( cy.contains('Learn').click() cy.contains('Songs').click() cy.contains('Use list view').click() - cy.get('[data-testid="SongAndStoriesListRow"]').each((_song) => { + cy.get('.pb-16 > .w-full >').each((_song) => { cy.wrap(_song).scrollIntoView() cy.wrap(_song).should('be.enabled') cy.wrap(_song).click() diff --git a/cypress/e2e/stories.cy.js b/cypress/e2e/stories.cy.js index 7ac72312..587c2432 100644 --- a/cypress/e2e/stories.cy.js +++ b/cypress/e2e/stories.cy.js @@ -29,16 +29,14 @@ describe( cy.contains('Learn').click() cy.contains('Stories').click() cy.contains('Use list view').click() - cy.get('[data-testid="SongAndStoriesListRow"]', { timeout: 10000 }).each( - (_song) => { - cy.wrap(_song).should('be.enabled') - cy.wrap(_song).click() - cy.contains('Loading').should('not.exist') - cy.contains('Go to Story').scrollIntoView() - cy.contains('Go to Story').should('be.visible') - cy.get('#CloseDrawerBtn').click() - }, - ) + cy.get('.pb-16 > .w-full >', { timeout: 10000 }).each((_song) => { + cy.wrap(_song).should('be.enabled') + cy.wrap(_song).click() + cy.contains('Loading').should('not.exist') + cy.contains('Go to Story').scrollIntoView() + cy.contains('Go to Story').should('be.visible') + cy.get('#CloseDrawerBtn').click() + }) }) }, ) // end of describe