Move Cypress tests under tests/ directory

Bug: T358851
Change-Id: I084f4e098c00d4c1bbcb0e692a2be3b1f8ce59a2
This commit is contained in:
thiemowmde 2024-04-03 12:16:21 +02:00 committed by Thiemo Kreuz (WMDE)
parent 8b57438abb
commit d2a244b753
11 changed files with 15 additions and 16 deletions

8
.gitignore vendored
View file

@ -24,8 +24,8 @@ sublime-*
sftp-config.json sftp-config.json
.eslintcache .eslintcache
/cypress/.cache /tests/cypress/.cache
/cypress/videos /tests/cypress/videos
/cypress/screenshots /tests/cypress/screenshots
/cypress/downloads /tests/cypress/downloads
/docs/js /docs/js

2
.npmrc
View file

@ -1,2 +1,2 @@
# Controls where the cypress binary is downloaded during `npm install` # Controls where the cypress binary is downloaded during `npm install`
CYPRESS_CACHE_FOLDER=./cypress/.cache CYPRESS_CACHE_FOLDER=./tests/cypress/.cache

View file

@ -22,7 +22,7 @@ module.exports = function ( grunt ) {
all: [ all: [
'**/*.{js,json}', '**/*.{js,json}',
'!{docs,vendor,node_modules}/**', '!{docs,vendor,node_modules}/**',
'!cypress/screenshots/**/*.js' '!tests/cypress/screenshots/**/*.js'
] ]
}, },
banana: conf.MessagesDirs, banana: conf.MessagesDirs,

View file

@ -3,8 +3,8 @@
"private": true, "private": true,
"scripts": { "scripts": {
"selenium-daily": "npm run selenium-test", "selenium-daily": "npm run selenium-test",
"selenium-test": "CYPRESS_CACHE_FOLDER=./cypress/.cache cypress run", "selenium-test": "CYPRESS_CACHE_FOLDER=./tests/cypress/.cache cypress run --config-file tests/cypress/cypress.config.js",
"cypress:open": "CYPRESS_CACHE_FOLDER=./cypress/.cache cypress open", "cypress:open": "CYPRESS_CACHE_FOLDER=./tests/cypress/.cache cypress open --config-file tests/cypress/cypress.config.js",
"doc": "jsdoc -c jsdoc.json", "doc": "jsdoc -c jsdoc.json",
"test": "grunt test", "test": "grunt test",
"lint:fix": "grunt test --fix" "lint:fix": "grunt test --fix"

View file

@ -1,25 +1,23 @@
'use strict';
/* eslint-env node */ /* eslint-env node */
const { defineConfig } = require( 'cypress' ); const { defineConfig } = require( 'cypress' );
// const { mwApiCommands } = require( './cypress/support/MwApiPlugin.js' ); // const { mwApiCommands } = require( './tests/cypress/support/MwApiPlugin.js' );
const envLogDir = process.env.LOG_DIR ? process.env.LOG_DIR + '/Cite' : null; const envLogDir = process.env.LOG_DIR ? process.env.LOG_DIR + '/Cite' : null;
module.exports = defineConfig( { module.exports = defineConfig( {
e2e: { e2e: {
supportFile: false, supportFile: false,
specPattern: 'tests/cypress/e2e/**/*.cy.js',
baseUrl: process.env.MW_SERVER + process.env.MW_SCRIPT_PATH, baseUrl: process.env.MW_SERVER + process.env.MW_SCRIPT_PATH,
mediawikiAdminUsername: process.env.MEDIAWIKI_USER, mediawikiAdminUsername: process.env.MEDIAWIKI_USER,
mediawikiAdminPassword: process.env.MEDIAWIKI_PASSWORD mediawikiAdminPassword: process.env.MEDIAWIKI_PASSWORD
}, },
retries: 2, retries: 2,
defaultCommandTimeout: 5000, // ms; default is 4000ms defaultCommandTimeout: 5000, // ms; default is 4000ms
screenshotsFolder: envLogDir || 'cypress/screenshots', screenshotsFolder: envLogDir || 'tests/cypress/screenshots',
video: true, video: true,
videosFolder: envLogDir || 'cypress/videos', videosFolder: envLogDir || 'tests/cypress/videos',
downloadsFolder: envLogDir || 'cypress/downloads' downloadsFolder: envLogDir || 'tests/cypress/downloads'
} ); } );

View file

@ -57,7 +57,8 @@ describe( 'Re-using refs in Visual Editor', () => {
// ARTICLE SECTION // ARTICLE SECTION
// Ref has been added to article, there are now 4 refs in the article // Ref has been added to article, there are now 4 refs in the article
helpers.getRefsFromArticleSection().should( 'have.length', 4 ); helpers.getRefsFromArticleSection().should( 'have.length', 4 );
// Ref #2 now appears twice in the article with corresponding IDs matching the backlinks in the references section // Ref #2 now appears twice in the article with corresponding IDs matching the backlinks in
// the references section
helpers.backlinksIdShouldMatchFootnoteId( 2, 0, 2 ); helpers.backlinksIdShouldMatchFootnoteId( 2, 0, 2 );
helpers.backlinksIdShouldMatchFootnoteId( 3, 1, 2 ); helpers.backlinksIdShouldMatchFootnoteId( 3, 1, 2 );