Add some code help to cypress folder

This commit is contained in:
Ramon Wenger 2021-03-14 21:51:02 +01:00
parent e4839df4db
commit f3bf5b6b89
3 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,5 @@
module.exports = {
"extends": [
"plugin:cypress/recommended"
]
}

26
client/cypress/support/index.d.ts vendored Normal file
View File

@ -0,0 +1,26 @@
// Intellisense for custom Commands: https://github.com/cypress-io/cypress-example-todomvc#cypress-intellisense
declare namespace Cypress {
interface Chainable<Subject> {
/**
* Login via API call to the GraphQL endpoint, without calling the frontend. Faster than the other login.
* @param username
* @param password
* @example
* cy.apolloLogin('nico.zickgraf', 'test')
*/
apolloLogin(username: string, password: string): Chainable<any>
/**
* Selects an element based on the `data-cy=xxx` attribute
* @param selector - The value of the data-cy attribute to select
* @example
* cy.dataCy('my-new-button')
*/
dataCy(selector: string): Chainable<any>
selectClass(schoolClass: string): void
login(username:string, password:string, visitLogin?: boolean): void
fakeLogin(username:string, password:string): void
}
}

View File

@ -0,0 +1,13 @@
{
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"resolveJsonModule": true,
"types": [
"cypress"
]
},
"include": [
"**/*.*"
]
}