From ccaa7cb7df53fa3f47b0020317e927ae708c7297 Mon Sep 17 00:00:00 2001 From: blam Date: Thu, 4 Feb 2021 20:14:46 +0100 Subject: [PATCH] chore: added some more simple stuff for e2e tests with cypress --- packages/e2e-test/src/commands/cypress.ts | 9 +++++++-- packages/e2e-test/src/cypress/fixtures/.gitkeep | 0 packages/e2e-test/src/cypress/plugins/index.ts | 17 +++++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 packages/e2e-test/src/cypress/fixtures/.gitkeep create mode 100644 packages/e2e-test/src/cypress/plugins/index.ts diff --git a/packages/e2e-test/src/commands/cypress.ts b/packages/e2e-test/src/commands/cypress.ts index 866362c3dc..be947c87c8 100644 --- a/packages/e2e-test/src/commands/cypress.ts +++ b/packages/e2e-test/src/commands/cypress.ts @@ -15,7 +15,7 @@ */ import cypress from 'cypress'; -import config from '../cypress.json'; +import path from 'path'; export async function run({ watch }: { watch: boolean }) { const command = watch ? cypress.open : cypress.run; @@ -24,7 +24,12 @@ export async function run({ watch }: { watch: boolean }) { browser: 'chrome', config: { watchForFileChanges: watch, + baseUrl: process.env.BACKSTAGE_TEST_URL ?? 'http://localhost:7000', + integrationFolder: path.resolve(__dirname, '../cypress/integration'), + supportFile: path.resolve(__dirname, '../cypress/support'), + fixturesFolder: path.resolve(__dirname, '../cypress/fixtures'), + pluginsFile: path.resolve(__dirname, '../cypress/plugins'), + defaultCommandTimeout: 10000, }, - configFile: `${__dirname}/../cypress.json`, }); } diff --git a/packages/e2e-test/src/cypress/fixtures/.gitkeep b/packages/e2e-test/src/cypress/fixtures/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/e2e-test/src/cypress/plugins/index.ts b/packages/e2e-test/src/cypress/plugins/index.ts new file mode 100644 index 0000000000..4e230aca20 --- /dev/null +++ b/packages/e2e-test/src/cypress/plugins/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2021 Spotify AB + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export {};