chore: reworking folder structure to move cypress outside of the project

This commit is contained in:
blam
2021-02-09 09:44:19 +01:00
parent df9ca92c7d
commit 3ded45b814
17 changed files with 1557 additions and 110 deletions
-8
View File
@@ -1,8 +0,0 @@
{
"baseUrl": "http://localhost:7000",
"integrationFolder": "./src/cypress/integration",
"supportFile": "./src/cypress/support",
"fixturesFolder": "./src/cypress/fixures",
"pluginFile": "./src/cypress/plugins",
"defaultCommandTimeout": 10000
}
-3
View File
@@ -41,8 +41,5 @@
"watch": "./src",
"exec": "bin/e2e-test",
"ext": "ts"
},
"dependencies": {
"cypress": "^6.4.0"
}
}
-36
View File
@@ -1,36 +0,0 @@
/*
* 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.
*/
import cypress from 'cypress';
import path from 'path';
export async function run({ watch }: { watch: boolean }) {
const command = watch ? cypress.open : cypress.run;
await command({
reporter: 'junit',
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: false,
});
}
@@ -1,29 +0,0 @@
/*
* 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.
*/
/// <reference types="cypress" />
import 'os';
describe('Catalog', () => {
describe('default entities', () => {
it('displays the correct amount of entities from default config', () => {
cy.loginAsGuest();
cy.visit('/catalog');
cy.contains('Owned (7)').should('be.visible');
});
});
});
@@ -1,16 +0,0 @@
/*
* 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 default () => {};
@@ -1,25 +0,0 @@
/*
* 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.
*/
/// <reference types="cypress" />
Cypress.Commands.add('loginAsGuest', () => {
cy.visit('/', {
onLoad: (win: Window) =>
win.localStorage.setItem('@backstage/core:SignInPage:provider', 'guest'),
});
});
export {};
-10
View File
@@ -13,16 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/// <reference types="cypress" />
declare module 'zombie';
declare module 'pgtools';
declare namespace Cypress {
interface Chainable {
/**
* Login as guest
* @example cy.loginAsGuests
*/
loginAsGuest(): Chainable<Element>;
}
}