Skip to content

Commit

Permalink
update cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvainpolletvillard committed Jun 10, 2024
1 parent 6b7ecbb commit f37f773
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
12 changes: 12 additions & 0 deletions corrections/vue3/7-test/search-films/cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { defineConfig } = require('cypress')

module.exports = defineConfig({
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config)
},
baseUrl: 'http://localhost:5050',
},
})
3 changes: 0 additions & 3 deletions corrections/vue3/7-test/search-films/cypress.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,20 @@ describe('Authentication behavior', () => {
})

it('should login correctly', () => {
cy.visit('/')
cy.get("#email").type("[email protected]")
cy.get("#psw").type("test1234")
cy.get("button[type='submit']").click()
cy.get("#session-info").contains("Connecté en tant que John Smith")
})

it('should allow to search films when authenticated', () => {
cy.visit('/search')
cy.get("#email").type("[email protected]")
cy.get("#psw").type("test1234")
cy.get("button[type='submit']").click()
cy.get("#session-info").contains("Connecté en tant que John Smith")

cy.get("#search").type("batman{enter}")
cy.wait(2000)
cy.get(".film.card .title").contains("Batman v Superman")
Expand Down

0 comments on commit f37f773

Please sign in to comment.