diff --git a/packages/e2e-test/cypress/plugins/index.js b/packages/e2e-test/cypress/plugins/index.js deleted file mode 100644 index aa9918d215..0000000000 --- a/packages/e2e-test/cypress/plugins/index.js +++ /dev/null @@ -1,21 +0,0 @@ -/// -// *********************************************************** -// This example plugins/index.js can be used to load plugins -// -// You can change the location of this file or turn off loading -// the plugins file with the 'pluginsFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/plugins-guide -// *********************************************************** - -// This function is called when a project is opened or re-opened (e.g. due to -// the project's config changing) - -/** - * @type {Cypress.PluginConfig} - */ -module.exports = (on, config) => { - // `on` is used to hook into various events Cypress emits - // `config` is the resolved Cypress config -} diff --git a/packages/e2e-test/src/commands/cypress.ts b/packages/e2e-test/src/commands/cypress.ts index 8d14c67402..866362c3dc 100644 --- a/packages/e2e-test/src/commands/cypress.ts +++ b/packages/e2e-test/src/commands/cypress.ts @@ -15,16 +15,16 @@ */ import cypress from 'cypress'; -import path from 'path'; import config from '../cypress.json'; -export async function run() { - await cypress.run({ +export async function run({ watch }: { watch: boolean }) { + const command = watch ? cypress.open : cypress.run; + await command({ reporter: 'junit', browser: 'chrome', config: { - watchForFileChanges: true, - ...config, + watchForFileChanges: watch, }, + configFile: `${__dirname}/../cypress.json`, }); } diff --git a/packages/e2e-test/src/commands/index.ts b/packages/e2e-test/src/commands/index.ts index aad051e603..0d14f37135 100644 --- a/packages/e2e-test/src/commands/index.ts +++ b/packages/e2e-test/src/commands/index.ts @@ -23,5 +23,6 @@ export function registerCommands(program: CommanderStatic) { program .command('cypress') .description('Run cypress e2e tests') + .option('-w, --watch', 'watch/open mode') .action(cypress); } diff --git a/packages/e2e-test/src/cypress.json b/packages/e2e-test/src/cypress.json index 7dba277a86..78392d60da 100644 --- a/packages/e2e-test/src/cypress.json +++ b/packages/e2e-test/src/cypress.json @@ -2,6 +2,5 @@ "baseUrl": "http://localhost:7000", "integrationFolder": "./cypress/integration", "supportFile": "./cypress/support", - "fixturesFolder": false, "defaultCommandTimeout": 10000 } diff --git a/packages/e2e-test/src/cypress/support/index.d.ts b/packages/e2e-test/src/cypress/integration/catalog.ts similarity index 66% rename from packages/e2e-test/src/cypress/support/index.d.ts rename to packages/e2e-test/src/cypress/integration/catalog.ts index c9e765f23e..1e805ee06c 100644 --- a/packages/e2e-test/src/cypress/support/index.d.ts +++ b/packages/e2e-test/src/cypress/integration/catalog.ts @@ -13,16 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -// in cypress/support/index.d.ts -// load type definitions that come with Cypress module -/// +import 'os'; -declare namespace Cypress { - interface Chainable { - /** - * Login as guest - * @example cy.loginAsGuests - */ - loginAsGuest(value: string): Chainable; - } -} +describe('Catalog', () => { + describe('default entities', () => { + it('displays the correct amount of entities from default config', () => { + cy.loginAsGuest(); + + cy.visit('/catalog'); + + cy.get('table').should('be.visible'); + }); + }); +}); diff --git a/packages/e2e-test/src/types.d.ts b/packages/e2e-test/src/types.d.ts index 0ae86490ee..0f9fe9a475 100644 --- a/packages/e2e-test/src/types.d.ts +++ b/packages/e2e-test/src/types.d.ts @@ -13,6 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +/// declare module 'zombie'; declare module 'pgtools'; +declare namespace Cypress { + interface Chainable { + /** + * Login as guest + * @example cy.loginAsGuests + */ + loginAsGuest(): Chainable; + } +}