-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
318 additions
and
3,451 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import { defineConfig } from 'cypress' | ||
import failFast from 'cypress-fail-fast/plugin'; | ||
import {deleteAsync} from 'del'; | ||
|
||
function runnableTestsRegex(...fileName: string[]): string { | ||
return `cypress/e2e/**/!(${fileName.reduce((prevName, name) => `${prevName}|${name}`)}).spec.ts`; | ||
} | ||
|
||
export default defineConfig({ | ||
chromeWebSecurity: false, | ||
screenshotOnRunFailure: true, | ||
videoCompression: false, | ||
pageLoadTimeout: 60000, | ||
defaultCommandTimeout: 60000, | ||
responseTimeout: 60000, | ||
requestTimeout: 60000, | ||
viewportHeight: 1080, | ||
viewportWidth: 1920, | ||
projectId: 'mdsuba', | ||
video: true, | ||
e2e: { | ||
setupNodeEvents(on, config) { | ||
const isAPIMocked = config.env.MOCKS === 'true' || config.env.MOCKS === true; | ||
const isEnterpriseEdition = config.env.KUBERMATIC_EDITION === 'ee'; | ||
// TODO: Update once more tests are rewritten | ||
// const ignored: string[] = ['cypress/**/!(service-accounts|ssh-keys).spec.ts']; | ||
const ignored: string[] = [ | ||
runnableTestsRegex( | ||
'service-accounts', | ||
'ssh-keys', | ||
'edition', | ||
'members', | ||
'defaults', | ||
'dynamic-datacenters' | ||
), | ||
]; | ||
|
||
// if (isAPIMocked) { | ||
// // TODO: Remove it after configuring mocks. | ||
// ignored = ['cypress/**/e2e/stories/opa.spec.ts']; | ||
// } else { | ||
// // TODO: Remove it after fixing flaky tests. | ||
// ignored = [ | ||
// 'cypress/**/e2e/providers/anexia.spec.ts', | ||
// 'cypress/**/e2e/providers/equinix.spec.ts', | ||
// 'cypress/**/e2e/providers/vsphere.spec.ts', | ||
// 'cypress/**/e2e/stories/opa.spec.ts', | ||
// 'cypress/**/e2e/stories/admin-settings/administrators.spec.ts', | ||
// ]; | ||
// } | ||
|
||
// Test providers only in enterprise edition. | ||
// if (!isEnterpriseEdition) { | ||
// ignored = ['cypress/**/e2e/providers/**', ...ignored]; | ||
// } | ||
|
||
/* eslint-disable no-console */ | ||
console.log('mocks: ' + isAPIMocked); | ||
console.log('enterprise edition: ' + isEnterpriseEdition); | ||
console.log('ignored: ' + ignored); | ||
/* eslint-enable no-console */ | ||
|
||
config.excludeSpecPattern = ignored; | ||
|
||
// Remove videos of successful tests and keep only failed ones. | ||
// @ts-ignore | ||
on('after:spec', (_, results) => { | ||
if (results.stats.failures === 0 && results.video) { | ||
return deleteAsync(results.video); | ||
} | ||
}); | ||
|
||
failFast(on, config); | ||
return config; | ||
}, | ||
baseUrl: 'http://localhost:8000', | ||
specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}', | ||
supportFile: "cypress/support/e2e.ts" | ||
}, | ||
}) |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.