Skip to content

Commit

Permalink
Fix E2E test
Browse files Browse the repository at this point in the history
  • Loading branch information
axelboc committed Jul 20, 2023
1 parent 6d6bf77 commit 653bd0b
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 55 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,6 @@ npm-debug.log*
/supervisord.pid
log
mxcube3/static

# Cypress debug screenshots
/cypress/debug/
7 changes: 7 additions & 0 deletions ui/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,12 @@ module.exports = createConfig({
'jest/require-top-level-describe': 'off', // filename should already be meaningful, extra nesting is unnecessary
},
}),
{
...dependencies,
files: ['**/*.cy.ts'],
rules: {
'sonarjs/no-duplicate-string': 'off', // incompatible with Cypress testing syntax
},
},
],
});
10 changes: 6 additions & 4 deletions ui/cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
const { defineConfig } = require('cypress');
import { defineConfig } from 'cypress';

module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
},
baseUrl: 'http://localhost:8081',
supportFile: 'cypress/support.js',
},
screenshotsFolder: 'cypress/debug',
fixturesFolder: false,
video: false,
});
7 changes: 3 additions & 4 deletions ui/cypress/e2e/app.cy.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
describe('app', () => {
it('loads the login page', () => {
cy.visit('http://localhost:8081');
cy.get('input[placeholder*="LoginID"]').should('be.visible');
cy.get('input[placeholder*="Password"]').should('be.visible');
cy.get('button[type=submit]').should('be.visible');
cy.getByRole('textbox', { label: 'Login ID' }).should('be.visible');
cy.getByRole('textbox', { label: 'Password' }).should('be.visible');
cy.getByRole('button', { label: 'Sign in' }).should('be.visible');
});
});
1 change: 1 addition & 0 deletions ui/cypress/support.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '@testing-library/cypress/add-commands';
27 changes: 0 additions & 27 deletions ui/cypress/support/commands.js

This file was deleted.

20 changes: 0 additions & 20 deletions ui/cypress/support/e2e.js

This file was deleted.

0 comments on commit 653bd0b

Please sign in to comment.