@argos-ci/cypress 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +4 -4
  2. package/package.json +5 -1
  3. package/support.js +2 -6
package/README.md CHANGED
@@ -20,7 +20,7 @@ import "@argos-ci/cypress/support";
20
20
 
21
21
  ## Usage
22
22
 
23
- `cy.argosScreenshot` - command stabilizes the UI and takes a screenshot.
23
+ `cy.argosScreenshot` command stabilizes the UI and takes a screenshot.
24
24
 
25
25
  _How to take a screenshot with `cy.argosScreenshot` command_
26
26
 
@@ -36,12 +36,12 @@ describe("Homepage", () => {
36
36
  });
37
37
  ```
38
38
 
39
- ### Configuration
39
+ ## API
40
40
 
41
- `cy.argosScreenshot([name][, options])`
41
+ ### cy.argosScreenshot([name][, options])
42
42
 
43
43
  - `name` - The screenshot name; must be unique; default value to test title
44
- - `options` - Send to [cy.screenshot command options](https://docs.cypress.io/api/commands/screenshot)
44
+ - `options` - See [cy.screenshot command options](https://docs.cypress.io/api/commands/screenshot)
45
45
 
46
46
  ## Helper attributes
47
47
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@argos-ci/cypress",
3
3
  "description": "Visual testing solution to avoid visual regression. Cypress commands and utilities for Argos visual testing.",
4
- "version": "0.0.2",
4
+ "version": "0.0.3",
5
5
  "author": "Smooth Code",
6
6
  "license": "MIT",
7
7
  "repository": "github:argos-ci/argos-cypress",
@@ -31,12 +31,16 @@
31
31
  "test": "cypress run",
32
32
  "test:open": "cypress open --e2e -b chrome",
33
33
  "format": "prettier --write .",
34
+ "check-format": "prettier --check .",
34
35
  "lint": "eslint --ignore-path .gitignore .",
35
36
  "release": "standard-version && conventional-github-releaser --preset angular"
36
37
  },
37
38
  "dependencies": {
38
39
  "cypress-wait-until": "^1.7.2"
39
40
  },
41
+ "peerDependencies": {
42
+ "cypress": ">=3"
43
+ },
40
44
  "devDependencies": {
41
45
  "@argos-ci/cli": "^0.1.2",
42
46
  "@argos-ci/cypress": "file:.",
package/support.js CHANGED
@@ -54,9 +54,6 @@ function waitUntilNoBusy() {
54
54
  );
55
55
  }
56
56
 
57
- /**
58
- * Takes a screenshot for Argos.
59
- */
60
57
  Cypress.Commands.add(
61
58
  "argosScreenshot",
62
59
  { prevSubject: ["optional", "element", "window", "document"] },
@@ -66,11 +63,10 @@ Cypress.Commands.add(
66
63
  name = null;
67
64
  }
68
65
 
69
- const screenshotName = `argos/${name || cy.state("runnable").fullTitle()}`;
70
66
  Cypress.log({
71
67
  name: "argosScreenshot",
72
68
  displayName: `Argos Screenshot`,
73
- message: screenshotName,
69
+ message: name,
74
70
  });
75
71
  // Inject styles
76
72
  cy.document().then((doc) => injectStyles(doc));
@@ -80,7 +76,7 @@ Cypress.Commands.add(
80
76
  cy.document().its("fonts.status").should("equal", "loaded");
81
77
 
82
78
  // Screenshot
83
- cy.wrap(subject).screenshot(screenshotName, {
79
+ cy.wrap(subject).screenshot(name, {
84
80
  blackout: ['[data-visual-test="blackout"]'].concat(
85
81
  options.blackout || []
86
82
  ),