From 4a242a3979ca9c30b45cbb4e9f85ee1f737df172 Mon Sep 17 00:00:00 2001 From: joe-allen-89 <85872286+joe-allen-89@users.noreply.github.com> Date: Mon, 4 Dec 2023 11:12:55 +0000 Subject: [PATCH 01/10] New: Cypress task log added, cypress commands file added, cypress getData command added. --- cypress.config.js | 10 ++++++++- package-lock.json | 4 ++-- src/core | 2 +- test.js | 4 ++-- test/e2e/commands.js | 46 +++++++++++++++++++++++++++++++++++++++++ test/e2e/menuPage.cy.js | 11 +++++++--- 6 files changed, 68 insertions(+), 9 deletions(-) create mode 100644 test/e2e/commands.js diff --git a/cypress.config.js b/cypress.config.js index 61bed1e97..76572992a 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -6,6 +6,14 @@ module.exports = defineConfig({ screenshotOnRunFailure: false, video: false, supportFile: false, - specPattern: '**/test/e2e/**/*.cy.{js,jsx}' + specPattern: '**/test/e2e/**/*.cy.{js,jsx}', + setupNodeEvents (on, config) { + on('task', { + log(message) { + console.log(message); + return null; + } + }); + } } }); diff --git a/package-lock.json b/package-lock.json index e539ae813..06fea5426 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "adapt_framework", - "version": "5.33.6", + "version": "5.33.7", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "adapt_framework", - "version": "5.33.6", + "version": "5.33.7", "hasInstallScript": true, "license": "GPL-3.0", "dependencies": { diff --git a/src/core b/src/core index e90414c74..9a212ca66 160000 --- a/src/core +++ b/src/core @@ -1 +1 @@ -Subproject commit e90414c74cdbb144cdabf4fd592e92bc5a790054 +Subproject commit 9a212ca66e4b9a97738d6fc03a15074f6113eab8 diff --git a/test.js b/test.js index 2f0bb75ca..38fbfd6af 100644 --- a/test.js +++ b/test.js @@ -82,7 +82,7 @@ async function waitForGruntServer() { }; async function cypressRun() { - return asyncSpawn('node', './node_modules/cypress/bin/cypress', 'run'); + return asyncSpawn('node', './node_modules/cypress/bin/cypress', 'run', '--config', `{"fixturesFolder": "${outputDir}course/en"}`); }; async function jestRun() { @@ -130,7 +130,7 @@ ${Object.values(commands).map(({ name, description }) => ` ${name.padEnd(21, description: 'Run prepare and e2e testing', async start() { const gruntServerRun = await gruntServer(); - await waitForGruntServer(); + waitForGruntServer(); const cypressCode = await cypressRun(); if (cypressCode > 0) { diff --git a/test/e2e/commands.js b/test/e2e/commands.js new file mode 100644 index 000000000..82af28cde --- /dev/null +++ b/test/e2e/commands.js @@ -0,0 +1,46 @@ +const path = require('path'); + +/* +function flatten (arr) { + try { + const allData = arr.reduce((result, fileData) => { + if (Array.isArray(fileData)) { + result.push(...fileData); + } else if (fileData instanceof Object) { + result.push(fileData); + } + return result; + }, []); + cy.wrap(allData).as('allData'); + } catch { + cy.task('log', 'Issue with flatten'); + } +} +*/ + +const loadManifestFiles = () => { + try { + const manifest = 'language_data_manifest.js'; + let allFileData = []; + cy.fixture(manifest).as('manifest_data').then((data) => { + data.forEach((item) => { + const name = path.parse(item).name; + cy.fixture(item).as(`${name}Data`).then((data) => { + allFileData.push(data); + }); + }); + }).then(() => { + // Potentially flatten data as with FW data.js + // flatten(allFileData); + }); + } catch { + cy.task('log', 'fail'); + } + +}; + +function getData() { + cy.wrap(loadManifestFiles()); +} + +Cypress.Commands.add('getData', getData); diff --git a/test/e2e/menuPage.cy.js b/test/e2e/menuPage.cy.js index 3d8a0239d..c28662700 100644 --- a/test/e2e/menuPage.cy.js +++ b/test/e2e/menuPage.cy.js @@ -1,8 +1,13 @@ +import {getData} from './commands' + describe('Menu Page', () => { - const pageTitle = 'Adapt Version 5'; - it(`should have the title ${pageTitle}`, () => { + beforeEach(() => { + cy.getData() + }) + + it(`should have the correct title`, function () { cy.visit('/'); - cy.get('.menu__title-inner').should('contain', pageTitle); + cy.get('.menu__title-inner').should('contain', this.courseData.displayTitle); }); }); From 06d5347596372dde839d98d87d1641c9f480d159 Mon Sep 17 00:00:00 2001 From: joe-allen-89 <85872286+joe-allen-89@users.noreply.github.com> Date: Tue, 5 Dec 2023 16:31:32 +0000 Subject: [PATCH 02/10] let updated to const. Co-authored-by: Cahir O'Doherty <41006337+cahirodoherty-learningpool@users.noreply.github.com> --- test/e2e/commands.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/commands.js b/test/e2e/commands.js index 82af28cde..3cc089902 100644 --- a/test/e2e/commands.js +++ b/test/e2e/commands.js @@ -21,7 +21,7 @@ function flatten (arr) { const loadManifestFiles = () => { try { const manifest = 'language_data_manifest.js'; - let allFileData = []; + const allFileData = []; cy.fixture(manifest).as('manifest_data').then((data) => { data.forEach((item) => { const name = path.parse(item).name; From 53f9b63afc8caea2ef35f46948da1b71dd2baeb3 Mon Sep 17 00:00:00 2001 From: joe-allen-89 <85872286+joe-allen-89@users.noreply.github.com> Date: Tue, 5 Dec 2023 16:49:09 +0000 Subject: [PATCH 03/10] explicit import removed, import still required. --- test/e2e/menuPage.cy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/menuPage.cy.js b/test/e2e/menuPage.cy.js index c28662700..59698f55d 100644 --- a/test/e2e/menuPage.cy.js +++ b/test/e2e/menuPage.cy.js @@ -1,4 +1,4 @@ -import {getData} from './commands' +import './commands'; describe('Menu Page', () => { From fc96e7e0bb072b647a6bc29bfafd9be7e6b5d8cc Mon Sep 17 00:00:00 2001 From: Oliver Foster Date: Wed, 20 Dec 2023 17:23:51 +0000 Subject: [PATCH 04/10] Updated to make the data loading .json file and language agnostic --- .eslintrc.json | 3 +- cypress.config.js | 2 +- test.js | 2 +- test/e2e/commands.js | 112 ++++++++++++++++++++++++++++------------ test/e2e/menuPage.cy.js | 10 ++-- 5 files changed, 87 insertions(+), 42 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index b24ffefb2..2a33bac4f 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -4,7 +4,8 @@ "commonjs": false, "es2022": true, "amd": true, - "jest": true + "jest": true, + "cypress": true }, "extends": [ "standard", diff --git a/cypress.config.js b/cypress.config.js index 76572992a..c85abfee2 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -5,7 +5,7 @@ module.exports = defineConfig({ baseUrl: 'http://localhost:9001/', screenshotOnRunFailure: false, video: false, - supportFile: false, + supportFile: '**/test/e2e/commands.js', specPattern: '**/test/e2e/**/*.cy.{js,jsx}', setupNodeEvents (on, config) { on('task', { diff --git a/test.js b/test.js index 38fbfd6af..5518c06b6 100644 --- a/test.js +++ b/test.js @@ -82,7 +82,7 @@ async function waitForGruntServer() { }; async function cypressRun() { - return asyncSpawn('node', './node_modules/cypress/bin/cypress', 'run', '--config', `{"fixturesFolder": "${outputDir}course/en"}`); + return asyncSpawn('node', './node_modules/cypress/bin/cypress', 'run', '--config', `{"fixturesFolder": "${outputDir}"}`); }; async function jestRun() { diff --git a/test/e2e/commands.js b/test/e2e/commands.js index 3cc089902..5e1db5625 100644 --- a/test/e2e/commands.js +++ b/test/e2e/commands.js @@ -1,38 +1,84 @@ -const path = require('path'); - -/* -function flatten (arr) { - try { - const allData = arr.reduce((result, fileData) => { - if (Array.isArray(fileData)) { - result.push(...fileData); - } else if (fileData instanceof Object) { - result.push(fileData); - } - return result; - }, []); - cy.wrap(allData).as('allData'); - } catch { - cy.task('log', 'Issue with flatten'); - } -} -*/ - const loadManifestFiles = () => { try { - const manifest = 'language_data_manifest.js'; - const allFileData = []; - cy.fixture(manifest).as('manifest_data').then((data) => { - data.forEach((item) => { - const name = path.parse(item).name; - cy.fixture(item).as(`${name}Data`).then((data) => { - allFileData.push(data); - }); - }); - }).then(() => { - // Potentially flatten data as with FW data.js - // flatten(allFileData); + // Setup data array + const data = []; + // Expose this.data in cypress + cy.wrap(data).as('data'); + // Allow adapt-style shorthand properties: + // this.data.config, this.data.course, this.data.articles, etc + Object.defineProperties(data, { + config: { + get() { + return data.find(item => item._type === 'config'); + }, + enumerable: false + }, + course: { + get() { + return data.find(item => item._type === 'course'); + }, + enumerable: false + }, + contentObjects: { + get() { + return data.filter(item => ['menu','page'].includes(item._type)); + }, + enumerable: false + }, + articles: { + get() { + return data.filter(item => item._type === 'article'); + }, + enumerable: false + }, + blocks: { + get() { + return data.filter(item => item._type === 'block'); + }, + enumerable: false + }, + components: { + get() { + return data.filter(item => item._type === 'component'); + }, + enumerable: false + } }); + // Load the config.json + cy + .fixture('course/config.json') + .then(configData => { + // Assign _type = 'config' to the config object + configData._type = 'config'; + data.push(configData); + // Fetch the default language + const defaultLanguage = configData._defaultLanguage; + // Load the language_data_manifest.js for the default language + cy + .fixture(`course/${defaultLanguage}/language_data_manifest.js`) + .then(languageDataManifest => { + // Load each of the files specified in the manifest + languageDataManifest.forEach(localFilePath => { + const filePath = `course/${defaultLanguage}/${localFilePath}` + cy + .fixture(filePath) + .then(fileData => { + // Add __index__ and __path__ attributes to each object as in adapt + // so that each object's origin can be identified later if necessary + if (Array.isArray(fileData)) { + fileData.forEach((item, index) => { + item.__index__ = index; + item.__path__ = filePath; + data.push(item); + }); + return data.push(...fileData); + } + fileData.__path__ = filePath; + data.push(fileData); + }); + }); + }) + }); } catch { cy.task('log', 'fail'); } @@ -40,7 +86,7 @@ const loadManifestFiles = () => { }; function getData() { - cy.wrap(loadManifestFiles()); + loadManifestFiles(); } Cypress.Commands.add('getData', getData); diff --git a/test/e2e/menuPage.cy.js b/test/e2e/menuPage.cy.js index 59698f55d..87afadd18 100644 --- a/test/e2e/menuPage.cy.js +++ b/test/e2e/menuPage.cy.js @@ -1,13 +1,11 @@ -import './commands'; - describe('Menu Page', () => { beforeEach(() => { - cy.getData() - }) + cy.getData(); + }); - it(`should have the correct title`, function () { + it('should have the correct title', function () { cy.visit('/'); - cy.get('.menu__title-inner').should('contain', this.courseData.displayTitle); + cy.get('.menu__title-inner').should('contain', this.data.course.displayTitle); }); }); From f82b172819d981e6c9c3f0eb2b134ef71d951229 Mon Sep 17 00:00:00 2001 From: Oliver Foster Date: Wed, 20 Dec 2023 17:34:42 +0000 Subject: [PATCH 05/10] Revert changes to config.json --- src/course/config.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/course/config.json b/src/course/config.json index 4a25acc90..9b0c4a745 100644 --- a/src/course/config.json +++ b/src/course/config.json @@ -48,10 +48,10 @@ "_duration": 400 }, "_completionCriteria": { - "_requireContentCompleted": false, - "_requireAssessmentCompleted": true, + "_requireContentCompleted": true, + "_requireAssessmentCompleted": false, "_shouldSubmitScore": true, - "_submitOnEveryAssessmentAttempt": true + "_submitOnEveryAssessmentAttempt": false }, "_spoor": { "_isEnabled": true, From 1d64b6c61fc774894e7e8597d21fb52b40b90f0f Mon Sep 17 00:00:00 2001 From: Oliver Foster Date: Wed, 20 Dec 2023 17:40:05 +0000 Subject: [PATCH 06/10] Revert unawait grunt server --- test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.js b/test.js index 4a292ff44..c84d8fa72 100644 --- a/test.js +++ b/test.js @@ -164,7 +164,7 @@ ${Object.values(commands).map(({ name, description }) => ` ${name.padEnd(21, description: 'Run prepare and e2e testing', async start() { const gruntServerRun = await gruntServer(); - waitForGruntServer(); + await waitForGruntServer(); const cypressCode = await cypressRun(); if (cypressCode > 0) { From 9e4ece1be23def40704714bd4d4b42ba7959b780 Mon Sep 17 00:00:00 2001 From: Oliver Foster Date: Wed, 20 Dec 2023 17:47:26 +0000 Subject: [PATCH 07/10] Specify coursedir as variable --- test/e2e/commands.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/e2e/commands.js b/test/e2e/commands.js index dd980176c..6bb85bbb5 100644 --- a/test/e2e/commands.js +++ b/test/e2e/commands.js @@ -44,18 +44,19 @@ function getData() { enumerable: false } }); + const coursedir = 'course'; // Load the config.json - cy.fixture('course/config.json').then(configData => { + cy.fixture(`${coursedir}/config.json`).then(configData => { // Assign _type = 'config' to the config object configData._type = 'config'; data.push(configData); // Fetch the default language const defaultLanguage = configData._defaultLanguage; // Load the language_data_manifest.js for the default language - cy.fixture(`course/${defaultLanguage}/language_data_manifest.js`).then(languageDataManifest => { + cy.fixture(`${coursedir}/${defaultLanguage}/language_data_manifest.js`).then(languageDataManifest => { // Load each of the files specified in the manifest languageDataManifest.forEach(localFilePath => { - const filePath = `course/${defaultLanguage}/${localFilePath}` + const filePath = `${coursedir}/${defaultLanguage}/${localFilePath}` cy.fixture(filePath).then(fileData => { // Add __index__ and __path__ attributes to each object as in adapt // so that each object's origin can be identified later if necessary From f9834e3cd97e9b51419b21c36bc729875af49179 Mon Sep 17 00:00:00 2001 From: Oliver Foster Date: Thu, 21 Dec 2023 13:17:41 +0000 Subject: [PATCH 08/10] Allow multilanguage, alternate coursedir and build config in tests --- grunt/helpers/Data.js | 2 +- grunt/helpers/data/Language.js | 9 ++-- test/e2e/commands.js | 93 +++++++++++++++++++++------------- test/e2e/config.cy.js | 11 ++++ test/e2e/languages.cy.js | 17 +++++++ test/e2e/menuPage.cy.js | 11 ---- test/e2e/trackingIds.cy.js | 22 ++++++++ 7 files changed, 116 insertions(+), 49 deletions(-) create mode 100644 test/e2e/config.cy.js create mode 100644 test/e2e/languages.cy.js delete mode 100644 test/e2e/menuPage.cy.js create mode 100644 test/e2e/trackingIds.cy.js diff --git a/grunt/helpers/Data.js b/grunt/helpers/Data.js index 8c7ea070d..8ee38cada 100644 --- a/grunt/helpers/Data.js +++ b/grunt/helpers/Data.js @@ -70,7 +70,7 @@ class Data { }); language.load(); return language; - }); + }).filter(lang => lang.isValid); this.configFile = new JSONFile({ framework: this.framework, path: path.join(coursePath, `config.${this.jsonext}`) diff --git a/grunt/helpers/data/Language.js b/grunt/helpers/data/Language.js index 003e42db6..2cb10dabe 100644 --- a/grunt/helpers/data/Language.js +++ b/grunt/helpers/data/Language.js @@ -107,18 +107,21 @@ class Language { return index; }, {}); - this.getCourseFileItem(); - return this; } + /** @type {boolean} */ + get isValid() { + return Boolean(this.courseFileItem); + } + /** @type {boolean} */ get hasChanged() { return this.files.some(file => file.hasChanged); } /** - * Produces a manifest file for the Framework data layer at course/language_data_manifest.js. + * Produces a manifest file for the Framework data layer at course/lang/language_data_manifest.js. * @returns {Language} */ saveManifest() { diff --git a/test/e2e/commands.js b/test/e2e/commands.js index 6bb85bbb5..230ee9f16 100644 --- a/test/e2e/commands.js +++ b/test/e2e/commands.js @@ -1,18 +1,33 @@ -function getData() { +function getBuild() { + try { + return cy.fixture(`adapt/js/build.min.js`).then(build => { + // Return the data for cy.getBuild().then(build => {}); + return cy.wrap(build).as('build'); + }); + } catch { + cy.task('log', 'fail'); + } +} + +function getConfig() { + return getBuild().then(build => { + // Load the config.json + return cy.fixture(`${build.coursedir}/config.json`).then(config => { + // Return the config for cy.getConfig().then(config => {}); + return cy.wrap(config).as('config'); + }); + }); +} + +function getData(languageCode = null) { try { // Setup data array const data = []; // Expose this.data in cypress cy.wrap(data).as('data'); // Allow adapt-style shorthand properties: - // this.data.config, this.data.course, this.data.articles, etc + // this.data.course, this.data.contentObjects, this.data.articles, etc Object.defineProperties(data, { - config: { - get() { - return data.find(item => item._type === 'config'); - }, - enumerable: false - }, course: { get() { return data.find(item => item._type === 'course'); @@ -44,39 +59,49 @@ function getData() { enumerable: false } }); - const coursedir = 'course'; - // Load the config.json - cy.fixture(`${coursedir}/config.json`).then(configData => { - // Assign _type = 'config' to the config object - configData._type = 'config'; - data.push(configData); - // Fetch the default language - const defaultLanguage = configData._defaultLanguage; - // Load the language_data_manifest.js for the default language - cy.fixture(`${coursedir}/${defaultLanguage}/language_data_manifest.js`).then(languageDataManifest => { - // Load each of the files specified in the manifest - languageDataManifest.forEach(localFilePath => { - const filePath = `${coursedir}/${defaultLanguage}/${localFilePath}` - cy.fixture(filePath).then(fileData => { - // Add __index__ and __path__ attributes to each object as in adapt - // so that each object's origin can be identified later if necessary - if (Array.isArray(fileData)) { - fileData.forEach((item, index) => { - item.__index__ = index; - item.__path__ = filePath; - data.push(item); + return getBuild().then(build => { + const { + coursedir, + availableLanguageNames + } = build; + // Load the config.json + return getConfig({ coursedir }).then(config => { + // Check that the specified language is available + const defaultLanguage = config._defaultLanguage; + languageCode = languageCode ?? defaultLanguage; + if (!availableLanguageNames.includes(languageCode)) { + throw new Error(`Language code is not available: ${languageCode}`); + } + // Load the language_data_manifest.js for the default or specified language + cy.fixture(`${coursedir}/${languageCode}/language_data_manifest.js`).then(languageDataManifest => { + // Load each of the files specified in the manifest + languageDataManifest.forEach(localFilePath => { + const filePath = `${coursedir}/${languageCode}/${localFilePath}` + cy.fixture(filePath).then(fileData => { + // Add __index__ and __path__ attributes to each object as in adapt + // so that each object's origin can be identified later if necessary + if (Array.isArray(fileData)) { + fileData.forEach((item, index) => { + item.__index__ = index; + item.__path__ = filePath; + }); + data.push(...fileData); + return; + } + fileData.__path__ = filePath; + data.push(fileData); }); - return data.push(...fileData); - } - fileData.__path__ = filePath; - data.push(fileData); + }); }); + // Return the data for cy.getData(languageCode).then(data => {}); + return cy.wrap(data); }); - }) }); } catch { cy.task('log', 'fail'); } } +Cypress.Commands.add('getBuild', getBuild); +Cypress.Commands.add('getConfig', getConfig); Cypress.Commands.add('getData', getData); diff --git a/test/e2e/config.cy.js b/test/e2e/config.cy.js new file mode 100644 index 000000000..9ae160043 --- /dev/null +++ b/test/e2e/config.cy.js @@ -0,0 +1,11 @@ +describe('Config', function () { + + beforeEach(function () { + cy.getConfig(); + }); + + it('should have a valid direction', function () { + expect(this.config._defaultDirection).to.be.oneOf(['ltr', 'rtl']); + }); + +}); diff --git a/test/e2e/languages.cy.js b/test/e2e/languages.cy.js new file mode 100644 index 000000000..8b69c8f62 --- /dev/null +++ b/test/e2e/languages.cy.js @@ -0,0 +1,17 @@ +describe('Languages', function () { + + beforeEach(function () { + cy.getConfig().then(config => cy.getData(config._defaultLanguage)); + }); + + it('should have the default language', function () { + expect(this.build.availableLanguageNames).to.include(this.config._defaultLanguage); + }); + + it('should have data for all specified languages', function () { + this.build.availableLanguageNames.forEach(lang => { + cy.getData(lang); + }); + }); + +}); diff --git a/test/e2e/menuPage.cy.js b/test/e2e/menuPage.cy.js deleted file mode 100644 index 87afadd18..000000000 --- a/test/e2e/menuPage.cy.js +++ /dev/null @@ -1,11 +0,0 @@ -describe('Menu Page', () => { - - beforeEach(() => { - cy.getData(); - }); - - it('should have the correct title', function () { - cy.visit('/'); - cy.get('.menu__title-inner').should('contain', this.data.course.displayTitle); - }); -}); diff --git a/test/e2e/trackingIds.cy.js b/test/e2e/trackingIds.cy.js new file mode 100644 index 000000000..f43f82326 --- /dev/null +++ b/test/e2e/trackingIds.cy.js @@ -0,0 +1,22 @@ +describe('Tracking Ids', function () { + + beforeEach(function () { + cy.getBuild(); + }); + + it('should have specified tracking ids for all specified languages', function () { + const { + trackingIdType, + availableLanguageNames + } = this.build; + availableLanguageNames.forEach(lang => { + cy.getData(lang).then(data => { + const trackingIdItems = data.filter(item => item._type === trackingIdType); + trackingIdItems.forEach(item => { + expect(item).to.have.ownProperty('_trackingId'); + }); + }) + }); + }); + +}); From 90ea6ce83233d702af134169807bffd5c11f81f0 Mon Sep 17 00:00:00 2001 From: Oliver Foster Date: Thu, 21 Dec 2023 13:20:28 +0000 Subject: [PATCH 09/10] Updated comments --- test/e2e/commands.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/e2e/commands.js b/test/e2e/commands.js index 230ee9f16..d22432249 100644 --- a/test/e2e/commands.js +++ b/test/e2e/commands.js @@ -1,7 +1,8 @@ function getBuild() { try { return cy.fixture(`adapt/js/build.min.js`).then(build => { - // Return the data for cy.getBuild().then(build => {}); + // Return for cy.getBuild().then(build => {}); + // Expose this.build in cypress return cy.wrap(build).as('build'); }); } catch { @@ -13,7 +14,8 @@ function getConfig() { return getBuild().then(build => { // Load the config.json return cy.fixture(`${build.coursedir}/config.json`).then(config => { - // Return the config for cy.getConfig().then(config => {}); + // Return for cy.getConfig().then(config => {}); + // Expose this.config in cypress return cy.wrap(config).as('config'); }); }); @@ -93,7 +95,7 @@ function getData(languageCode = null) { }); }); }); - // Return the data for cy.getData(languageCode).then(data => {}); + // Return for cy.getData(languageCode).then(data => {}); return cy.wrap(data); }); }); From 68ef7506818382c08cb944d876bb3cdc3b70050f Mon Sep 17 00:00:00 2001 From: Oliver Foster Date: Thu, 21 Dec 2023 13:31:13 +0000 Subject: [PATCH 10/10] Removed bad argument --- test/e2e/commands.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/commands.js b/test/e2e/commands.js index d22432249..695657f6c 100644 --- a/test/e2e/commands.js +++ b/test/e2e/commands.js @@ -67,7 +67,7 @@ function getData(languageCode = null) { availableLanguageNames } = build; // Load the config.json - return getConfig({ coursedir }).then(config => { + return getConfig().then(config => { // Check that the specified language is available const defaultLanguage = config._defaultLanguage; languageCode = languageCode ?? defaultLanguage;