Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to turn off automatic steps and substeps creation for Cypress #1129

Open
tomaszwojciechowski opened this issue Sep 4, 2024 · 1 comment
Labels
theme:cypress type:new feature New feature or request

Comments

@tomaszwojciechowski
Copy link

It will be useful to have ability to turn off automatic steps and substeps creation for Cypress, and be able to use only those coded with allure.step

@delatrie delatrie added type:new feature New feature or request theme:cypress labels Sep 4, 2024
@nkr741
Copy link

nkr741 commented Nov 25, 2024

I am using allure.step() at Method level and it is also displaying the sub steps and i want to disable the sub steps. Her is the sample code
filerlogin() {
return allure.step('Click on Login as Filer', () => {
cy.xpath(CommonUtils.loginasfiler).click();
});
}

and i am trying to configure to disable the sub steps

const { defineConfig } = require('cypress');

const fs = require('fs-extra');
const path = require('path');
const { allureCypress } = require('allure-cypress/reporter');
const { Status } = require('allure-js-commons');
const os = require('os');
module.exports = defineConfig({
e2e: {
specPattern: 'cypress/e2e/**/*.cy.{js,jsx,ts,tsx}',
baseUrl: '[https://dev-abdgh.com]',
viewportWidth: 1920,
viewportHeight: 1080,
defaultCommandTimeout: 20000,
setupNodeEvents(on, config) {
const reportsPath = 'cypress/reports';
const accessibilityPath = ${reportsPath}/accessibility;
const allurePath = ${reportsPath}/allure-results;
const downloadsPath = 'cypress/downloads';
[reportsPath, accessibilityPath, allurePath, downloadsPath].forEach(dir => {
fs.ensureDirSync(dir);
});
allureCypress(on, config, {
resultsDir: allurePath,
reportPageTitle: 'Vermont CFIS Test Report',
environmentInfo: {
os_platform: os.platform(),
os_version: os.version(),
node_version: process.version
},
stepLevel: false,
stepTimings: false,
disableWebdriverStepsReporting: true,
disableStepReporting: true,
issueLinkTemplate: "{}",
tmsLinkTemplate: "{}",
hideExecutionSteps: true,
allureSkipAutomaticSteps: true,
addConsoleLogs: false,
addScreenshots: true
});
on('task', {
log(message) {
console.log(message);
return null;
},
saveA11yReport({ reportData, suiteName }) {
const sanitizedSuiteName = suiteName.replace(/[^a-z0-9]/gi, '-').toLowerCase();
const reportPath = path.join(accessibilityPath, ${sanitizedSuiteName}-accessibility-report.html);
fs.writeFileSync(reportPath, reportData);
return null;
},
getTimestamp() {
return Date.now();
},
deleteDownloadedFile(filename) {
const downloadedFilePath = path.join('cypress', 'downloads', filename);
try {
if (fs.existsSync(downloadedFilePath)) {
fs.removeSync(downloadedFilePath);
return true;
}
return null;
} catch (err) {
return Failed to delete file: ${err.message};
}
},
verifyDownload(filename) {
const downloadedFilePath = path.join('cypress', 'downloads', filename);
return fs.existsSync(downloadedFilePath);
}
});
return config;
}
},
watchForFileChanges: false,
chromeWebSecurity: false,
video: false,
screenshotOnRunFailure: true,
screenshotsFolder: 'cypress/reports/screenshots',
videosFolder: 'cypress/reports/videos',
retries: {
runMode: 1,
openMode: 0
},
downloadsFolder: 'cypress/downloads',
defaultCommandTimeout: 20000,
execTimeout: 20000,
taskTimeout: 20000,
pageLoadTimeout: 20000,
requestTimeout: 20000,
responseTimeout: 20000
})
However i am still getting the sub steps with the element level information which is not expected .
001

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme:cypress type:new feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants