-
Notifications
You must be signed in to change notification settings - Fork 5
/
cypress.config.ts
35 lines (31 loc) · 1.31 KB
/
cypress.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { defineConfig } from "cypress";
const envLogDir = process.env.LOG_DIR ? process.env.LOG_DIR + '/WikibaseLexeme' : null
if ( process.env.MW_SERVER === undefined || process.env.MW_SCRIPT_PATH === undefined ||
process.env.MEDIAWIKI_USER === undefined || process.env.MEDIAWIKI_PASSWORD === undefined ) {
throw new Error( "Please define MW_SERVER, MW_SCRIPT_PATH, " +
"MEDIAWIKI_USER and MEDIAWIKI_PASSWORD environment variables" );
}
process.env.REST_BASE_URL = process.env.MW_SERVER + process.env.MW_SCRIPT_PATH + '/';
import { mwApiCommands } from 'cypress-wikibase-api';
import { mwApiLexemeCommands } from './cypress/support/MwLexemePlugin';
export default defineConfig({
e2e: {
supportFile: 'cypress/support/e2e.ts',
baseUrl: process.env.MW_SERVER + process.env.MW_SCRIPT_PATH,
mediawikiAdminUsername: process.env.MEDIAWIKI_USER,
mediawikiAdminPassword: process.env.MEDIAWIKI_PASSWORD,
wikibasePropertyIds: {
string: process.env.WIKIBASE_PROPERTY_STRING
},
setupNodeEvents( on, config ) {
on( 'task', {
...mwApiCommands( config ),
...mwApiLexemeCommands( config, mwApiCommands(config) )
} );
},
defaultCommandTimeout: 20000,
},
screenshotsFolder: envLogDir || 'cypress/screenshots',
videosFolder: envLogDir || 'cypress/videos',
downloadsFolder: envLogDir || 'cypress/downloads'
});