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
.eslintcache
/cypress/.cache
/cypress/videos
/cypress/screenshots
/cypress/downloads
/tests/cypress/.cache
/tests/cypress/videos
/tests/cypress/screenshots
/tests/cypress/downloads
/docs/js

2
.npmrc
View file

@ -1,2 +1,2 @@
# 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: [
'**/*.{js,json}',
'!{docs,vendor,node_modules}/**',
'!cypress/screenshots/**/*.js'
'!tests/cypress/screenshots/**/*.js'
]
},
banana: conf.MessagesDirs,

View file

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

View file

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

View file

@ -57,7 +57,8 @@ describe( 'Re-using refs in Visual Editor', () => {
// ARTICLE SECTION
// Ref has been added to article, there are now 4 refs in the article
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( 3, 1, 2 );