spacedrive/apps/web/cypress.config.ts
Vítor Vasconcellos e5b57aa0ea
New test: Add location (#2222)
* New test: Add location
 - Add script to download some test files to allows tests to have a stable path for creating locations
 - Improve onboarding test
 - Add custom Cypress commands for fastOnboarding and deleteLibrary
 - Add some documentation related to tests to CONTRIBUTING.md
 - Update some deps

* Download small test-data for Cypress CI

* Replace globstar with find to make it compatible with bash 3.x

* Fix react too many re-renders
 - add-location test should now pass successfully

* Make job model task text match less flaky

* Check if we were redirected to onboarding after Library was deleted
 - Check if sidebar entry was created after adding a location
 - Put route regex's into a separate file
 - Make onboarding test ensure that no Library exists before running

* Enable test retries
 - Log cypress default config during test run

* Run tests under webkit
 - Pass CI envvar to tests to ensure correct cypress config

* Attempt fix CI config again

* Remove single use checkUrlIsLibrary function
2024-03-23 21:24:16 +00:00

42 lines
1.1 KiB
TypeScript

import { dirname, join, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { inspect } from 'node:util';
import { defineConfig } from 'cypress';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const ci_specific = {
// Double all the default timeouts
// https://docs.cypress.io/guides/references/configuration#Timeouts
defaultCommandTimeout: 4000 * 2,
execTimeout: 60000 * 2,
taskTimeout: 60000 * 2,
pageLoadTimeout: 60000 * 2,
requestTimeout: 5000 * 2,
responseTimeout: 30000 * 2,
// Enable test retries
// https://docs.cypress.io/guides/guides/test-retries#Configure-retry-attempts-for-all-modes
retries: 2
};
const config = defineConfig({
e2e: {
baseUrl: 'http://localhost:8002',
setupNodeEvents(on) {
on('task', {
repoRoot: () => {
return resolve(join(__dirname, '../../'));
}
});
}
},
video: true,
experimentalWebKitSupport: true,
...(process.env.CI === 'true' ? ci_specific : {})
});
console.log('Cypress default config:', inspect(config, { depth: null, colors: true }));
export default config;