Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

Commit 27c594e

Browse files
committed
feat: do not take screenshots in argos folder
1 parent 8f9a25a commit 27c594e

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

cypress/e2e/argosScreenshot.cy.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const screenshotsFolder = Cypress.browser.isHeaded
2-
? `./cypress/screenshots/argos`
3-
: `./cypress/screenshots/${Cypress.spec.name}/argos`;
2+
? `./cypress/screenshots`
3+
: `./cypress/screenshots/${Cypress.spec.name}`;
44

55
describe("argosScreenshot", () => {
66
before(() => {
@@ -24,7 +24,7 @@ describe("argosScreenshot", () => {
2424

2525
it("takes a screenshot with generic name", () => {
2626
cy.readFile(
27-
`${screenshotsFolder}/argosScreenshot without name before all hook.png`
27+
`${screenshotsFolder}/argosScreenshot -- without name -- waits for loader hiding -- before all hook.png`
2828
);
2929
});
3030
});

support.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ function waitUntilNoBusy() {
5454
);
5555
}
5656

57-
/**
58-
* Takes a screenshot for Argos.
59-
*/
6057
Cypress.Commands.add(
6158
"argosScreenshot",
6259
{ prevSubject: ["optional", "element", "window", "document"] },
@@ -66,11 +63,10 @@ Cypress.Commands.add(
6663
name = null;
6764
}
6865

69-
const screenshotName = `argos/${name || cy.state("runnable").fullTitle()}`;
7066
Cypress.log({
7167
name: "argosScreenshot",
7268
displayName: `Argos Screenshot`,
73-
message: screenshotName,
69+
message: name,
7470
});
7571
// Inject styles
7672
cy.document().then((doc) => injectStyles(doc));
@@ -80,7 +76,7 @@ Cypress.Commands.add(
8076
cy.document().its("fonts.status").should("equal", "loaded");
8177

8278
// Screenshot
83-
cy.wrap(subject).screenshot(screenshotName, {
79+
cy.wrap(subject).screenshot(name, {
8480
blackout: ['[data-visual-test="blackout"]'].concat(
8581
options.blackout || []
8682
),

0 commit comments

Comments
 (0)