Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,11 @@ export default defineConfig({
// implement node event listeners here
},
},

component: {
devServer: {
framework: "react",
bundler: "vite",
},
},
});
5 changes: 5 additions & 0 deletions cypress/e2e/mainspeac.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe('mainspeac.cy.js', () => {
it('playground', () => {
// cy.mount()
})
})
14 changes: 14 additions & 0 deletions cypress/mainspec.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
describe('mainspec.cy.js', () => {
it('passes', () => {
cy.visit('localhost:5173/')
cy.get('[data-qa="profile-box"]')
cy.get('data-qa="Comment-input"]').first().type('Test 123')
cy.get('[data-qa="publish-button"]').first().click()
cy.get('[data-qa="comment-texte"]').contains('Test 123')
cy.get('[data-qa="comment-texte"]').each(($element) => {
if ($element.text() === 'Test 123'){
cy.get($element).siblings('header').children('[data-qa="delete-button"]').click()
}
})
})
})
12 changes: 12 additions & 0 deletions cypress/support/component-index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Components App</title>
</head>
<body>
<div data-cy-root></div>
</body>
</html>
27 changes: 27 additions & 0 deletions cypress/support/component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// ***********************************************************
// This example support/component.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'

// Alternatively you can use CommonJS syntax:
// require('./commands')

import { mount } from 'cypress/react18'

Cypress.Commands.add('mount', mount)

// Example use:
// cy.mount(<MyComponent />)
Loading