0
0
Cypresstesting~10 mins

Why CI integration enables continuous testing in Cypress - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to run Cypress tests automatically in CI.

Cypress
describe('Login test', () => {
  it('should open login page', () => {
    cy.[1]('https://example.com/login')
  })
})
Drag options to blanks, or click blank then click option'
Avisit
Bwait
Ctype
Dclick
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'click' instead of 'visit' to open a page.
2fill in blank
medium

Complete the code to assert the login button is visible.

Cypress
cy.get('button#login').[1]('be.visible')
Drag options to blanks, or click blank then click option'
Ashould
Bclick
Ctype
Dwait
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'click' instead of 'should' for assertions.
3fill in blank
hard

Fix the error in the CI script to run Cypress tests.

Cypress
steps:
  - name: Run tests
    run: npm [1]
Drag options to blanks, or click blank then click option'
Ainstall
Btest
Cbuild
Dstart
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'npm install' instead of 'npm test' to run tests.
4fill in blank
hard

Fill both blanks to configure Cypress in GitHub Actions for continuous testing.

Cypress
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Setup Node.js
        uses: actions/setup-node@v2
        with:
          node-version: [1]
      - name: Install dependencies
        run: npm [2]
Drag options to blanks, or click blank then click option'
A16
Btest
Cinstall
D14
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'npm test' instead of 'npm install' to install dependencies.
5fill in blank
hard

Fill all three blanks to write a Cypress test that runs in CI and checks page title.

Cypress
describe('Home page', () => {
  it('has correct title', () => {
    cy.[1]('https://example.com')
    cy.title().[2]('eq', [3])
  })
})
Drag options to blanks, or click blank then click option'
Avisit
Bshould
C'Example Domain'
Dclick
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'click' instead of 'visit' to open the page.
Using 'expect' instead of 'should' for assertion.