You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
After upgrading to version 1.4.1 instead of displaying a failure message I see ReferenceError: Cypress is not defined:
1) Organization STO-1: UI - Settings - Organization:
ReferenceError: Cypress is not defined
at Object.handler (/tests/node_modules/@shelex/cypress-allure-plugin/writer.js:60:9)
at invoke (/Library/Caches/Cypress/4.3.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/child/run_plugins.js:21:16)
at /Library/Caches/Cypress/4.3.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/util.js:48:16
at tryCatcher (/Library/Caches/Cypress/4.3.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23)
at Function.Promise.attempt.Promise.try (/Library/Caches/Cypress/4.3.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/method.js:39:29)
at Object.wrapChildPromise (/Library/Caches/Cypress/4.3.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/util.js:47:28)
at execute (/Library/Caches/Cypress/4.3.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/child/run_plugins.js:92:12)
at EventEmitter.<anonymous> (/Library/Caches/Cypress/4.3.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/child/run_plugins.js:200:5)
at EventEmitter.emit (events.js:210:5)
at process.<anonymous> (/Library/Caches/Cypress/4.3.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/util.js:25:29)
at process.emit (events.js:210:5)
at emit (internal/child_process.js:876:12)
at processTicksAndRejections (internal/process/task_queues.js:81:21)
This works normally in version 1.4.0 and seems to be related to if (Cypress.env('allure') === true) part from 7ff767a
I have plugin is connected in index.js file:
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************
// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)
const fs = require("fs-extra");
const path = require("path");
const clipboardy = require("clipboardy");
const allureWriter = require("@shelex/cypress-allure-plugin/writer");
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
// accept a configFile value or use development by default
// https://docs.cypress.io/api/commands/task.html#Read-a-file-that-might-not-exist
on("task", {
readFileMaybe(filename) {
if (fs.existsSync(filename)) {
return fs.readFileSync(filename, "utf8");
}
return null;
},
});
on("task", {
getClipboard() {
return clipboardy.readSync();
},
});
const file = config.env.configFile || "development";
allureWriter(on);
return getConfigurationByFile(file);
};
function getConfigurationByFile(file) {
const pathToConfigFile = path.resolve("cypress/config", `${file}.json`);
return fs.readJson(pathToConfigFile);
}
Did I miss any changes in configuration?
Environment (please complete the following information):
Cypress version: 4.3.0
OS: Mac 10.14.6
Also reproduces in CircleCI
Unfortunately, I don't have a sample project to share, but may be able to create one if you need it.
The text was updated successfully, but these errors were encountered:
@onikiforov Published v1.5.4 where it should not throw error.
Now it will save screenshot to allure-results in case Cypress is not defined anyway.
It is connected to fact that sometimes Cypress after:screenshot event is emmited after test. Will do better investigation of that stuff if it could be handled in more elegant way.
Describe the bug
After upgrading to version 1.4.1 instead of displaying a failure message I see
ReferenceError: Cypress is not defined
:This works normally in version 1.4.0 and seems to be related to
if (Cypress.env('allure') === true)
part from 7ff767aI have plugin is connected in
index.js
file:Did I miss any changes in configuration?
Environment (please complete the following information):
Also reproduces in CircleCI
Unfortunately, I don't have a sample project to share, but may be able to create one if you need it.
The text was updated successfully, but these errors were encountered: