diff --git a/integration/e2e/assertions/assertions.cy.ts b/integration/e2e/assertions/assertions.cy.ts
index 311a5b89..ab5dc046 100644
--- a/integration/e2e/assertions/assertions.cy.ts
+++ b/integration/e2e/assertions/assertions.cy.ts
@@ -2,7 +2,6 @@ import { visitHtml } from '../../common/helper';
describe('assertions', () => {
beforeEach(() => {
- //visitHtml();
visitHtml({
body: `
@@ -85,6 +84,12 @@ describe('assertions', () => {
});
});
+ it('05 repro no assert', () => {
+ cy.qaId('task-card-title').should(subj => {
+ expect((subj as any as JQuery).text(), 'text should %NOT_PLACE% match').match(/Task Card/i);
+ });
+ });
+
it('01 assertion: should contain', () => {
cy.window().then(w => {
cy.get('div').should('contain', 'Some text');
diff --git a/src/plugins/allure-reporter-plugin.ts b/src/plugins/allure-reporter-plugin.ts
index 79b7129c..061bb8bd 100644
--- a/src/plugins/allure-reporter-plugin.ts
+++ b/src/plugins/allure-reporter-plugin.ts
@@ -264,6 +264,7 @@ export class AllureReporter {
if (title?.indexOf('before each') !== -1 || title?.indexOf('after each') !== -1) {
this.endStep({ status: this.currentStep?.isAnyStepFailed ? Status.FAILED : Status.PASSED });
+ this.endAllSteps({ status: UNKNOWN });
return;
}
diff --git a/src/setup/cypress-events.ts b/src/setup/cypress-events.ts
index 479c0363..62a7ce2a 100644
--- a/src/setup/cypress-events.ts
+++ b/src/setup/cypress-events.ts
@@ -20,7 +20,8 @@ const withTry = (message: string, callback: () => void) => {
};
const stepMessage = (name: string, args: string | undefined) => {
- const argsLine = args && args.length > ARGS_TRIM_AT ? '' : args && args.length > 0 ? `: ${args}` : '';
+ const argsLine =
+ args && args.length > ARGS_TRIM_AT && name !== 'assert' ? '' : args && args.length > 0 ? `: ${args}` : '';
return `${name}${argsLine}`;
};
@@ -376,7 +377,7 @@ export const handleCyLogEvents = (
Cypress.Allure.startStep(cmdMessage);
- if (log.message > ARGS_TRIM_AT) {
+ if (logName !== 'assert' && log.message && log.message.length > ARGS_TRIM_AT) {
Cypress.Allure.attachment(`${cmdMessage} args`, log.message, 'application/json');
}
Cypress.Allure.endStep(Status.PASSED);
diff --git a/tests/test-folder/mocha-events/commands/long-name-command.test.ts b/tests/test-folder/mocha-events/commands/long-name-command.test.ts
index 5fc605c8..65d9b57f 100644
--- a/tests/test-folder/mocha-events/commands/long-name-command.test.ts
+++ b/tests/test-folder/mocha-events/commands/long-name-command.test.ts
@@ -94,10 +94,17 @@ describe('custom commands', () => {
expect(steps).toEqual([
{
+ attach: [
+ {
+ name: 'tasklog1 args',
+ sourceContent:
+ '{"long":{"long":["chicken","chicken","chicken","chicken","chicken","chicken","chicken","chicken"]}}',
+ type: 'application/json',
+ },
+ ],
name: 'tasklog1',
steps: [
{
- name: 'task: log',
attach: [
{
name: 'task: log args',
@@ -106,24 +113,23 @@ describe('custom commands', () => {
type: 'application/json',
},
],
+ name: 'task: log',
steps: [
{
+ attach: [
+ {
+ name: 'task args',
+ sourceContent:
+ 'log, {"long":{"long":["chicken","chicken","chicken","chicken","chicken","chicken","chicken","chicken"]}}',
+ type: 'application/json',
+ },
+ ],
name: 'task',
- attach: [],
steps: [],
},
],
},
],
- attach: [
- {
- name: 'tasklog1 args',
- sourceContent:
- '{"long":{"long":["chicken","chicken","chicken","chicken","chicken","chicken","chicken","chicken"]}}',
-
- type: 'application/json',
- },
- ],
},
]);
});