Skip to content

Commit

Permalink
feat(testcafe): update testcafe version in peer dependency (#148)
Browse files Browse the repository at this point in the history
allow the users to upgrade testcafe up to version 3.5.0 without getting peer dependency warnings
  • Loading branch information
Arthy000 committed Jan 7, 2024
1 parent 20964e7 commit f115ec0
Show file tree
Hide file tree
Showing 7 changed files with 1,175 additions and 731 deletions.
11 changes: 8 additions & 3 deletions examples/custom-param-type-registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ const { ParameterTypeRegistry, ParameterType } = require('@cucumber/cucumber-exp
class Color {
constructor(name) {
this.name = `${name} color`;
this.code = {
red: '#FF0000',
green: '#00FF00',
blue: '#0000FF',
}[name];
}
}

Expand All @@ -11,10 +16,10 @@ const registry = new ParameterTypeRegistry();
registry.defineParameterType(
new ParameterType(
'color', // name
/red|blue|yellow/, // regexp
/red|green|blue/, // regexp
Color, // type
name => new Color(name) // transformer function
)
(name) => new Color(name), // transformer function
),
);

module.exports = registry;
9 changes: 4 additions & 5 deletions examples/custom-param-type.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ Feature: Using custom parameter types
I want to demonstrate the use of a custom "Color" parameter type

@googleHook
Scenario: Searching for color in Google
Scenario: Searching for blue color in Google
Given I opened Google's search page
And I dismissed the privacy statement when it appeared
When I search for the "blue" color on Google
And I press the "enter" key
Then I should see the "#0000FF" result in the page
Then I should see the corresponding code in the page

# here, blue and #0000FF are recognized by Cucumber as being respectively
# a color (based on the custome typing)
# and a word (based on Cucumber default types)
# blue is recognized by Cucumber as a color
# (based on the regexp in the custom type)
8 changes: 5 additions & 3 deletions examples/custom-param-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ const Selector = (input, t) => {
};

When('I search for the "{color}" color on Google', async (t, [color]) => {
t.ctx.selectedColor = color;
const input = Selector('[name="q"]', t);
await t.typeText(input, `${color.name} code`);
});

Then('I should see the "{word}" result in the page', async (t, [value]) => {
const result = Selector('td', t).withText(value);
await t.expect(result.visible).ok();
Then('I should see the corresponding code in the page', async (t) => {
const selectedColor = t.ctx.selectedColor;
const result = Selector('div[data-tts="answers"]>div', t);
await t.expect(result.innerText).contains(selectedColor.code);
});
2 changes: 1 addition & 1 deletion examples/google.feature
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Feature: The big search feature
Examples:
| keyword | result-text |
| facebook | Facebook |
| twitter | Twitter |
| twitter | X. |

@googleHook
Scenario: Searching for hook keyword on Google
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"peerDependencies": {
"@cucumber/cucumber": "^9.1.0",
"@cucumber/cucumber-expressions": "^16.0.0",
"testcafe": "2.0.0 - 3.2.0"
"testcafe": "2.0.0 - 3.5.0"
},
"devDependencies": {
"@cucumber/cucumber": "9.4.0",
Expand All @@ -76,7 +76,7 @@
"jest": "^29.6.4",
"prettier": "^3.0.2",
"standard-version": "^9.5.0",
"testcafe": "3.2.0"
"testcafe": "3.5.0"
},
"config": {
"commitizen": {
Expand Down
33 changes: 16 additions & 17 deletions version-matrix.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
Following combinations of versions of Gherkin-TestCafe and TestCafe have been tested and are compatible.

| GTC version | TC versions (peer dependencies) | TC versions (not peer dependencies) |
| ----------- | ------------------------------------ | ----------------------------------- |
| 7.1.2 | 2.0.0 - 3.2.0 | / |
| 7.1.1 | 2.0.0 - 3.2.0 | / |
| 7.1.0 | 2.0.0 - 3.1.0 | / |
| 7.0.0 | 2.0.0 - 2.5.0 | / |
| 6.0.1 | 2.0.0 - 2.5.0 | / |
| 6.0.0 | ~1.20.0 &#124;&#124; ^2.0.0 <= 2.3.1 | / |
| 5.6.0 | ~1.20.0 &#124;&#124; ^2.0.0 <= 2.2.0 | / |
| 5.5.2 | ~1.20.0 &#124;&#124; ^2.0.0 <= 2.1.0 | 2.2.0 |
| 5.5.1 | ~1.20.0 | ^2.0.0 <= 2.1.0 |
| 5.5.0 | ~1.20.0 | / |
| 5.4.4 | ~1.20.0 | / |
| 5.4.3 | ~1.18.0 &#124;&#124; 1.19.0 | / |

| GTC version | TC versions (peer dependencies) | TC versions (not peer dependencies) |
| - | - | - |
| 7.1.2 | 2.0.0 - 3.2.0 | / |
| 7.1.1 | ^2.0.0 <= 3.2.0 | / |
| 7.1.0 | ^2.0.0 <= 3.1.0 | / |
| 7.0.0 | ^2.0.0 <= 2.5.0 | / |
| 6.0.1 | ^2.0.0 <= 2.5.0 | / |
| 6.0.0 | ~1.20.0 &#124;&#124; ^2.0.0 <= 2.3.1 | / |
| 5.6.0 | ~1.20.0 &#124;&#124; ^2.0.0 <= 2.2.0 | / |
| 5.5.2 | ~1.20.0 &#124;&#124; ^2.0.0 <= 2.1.0 | 2.2.0 |
| 5.5.1 | ~1.20.0 | ^2.0.0 <= 2.1.0 |
| 5.5.0 | ~1.20.0 | / |
| 5.4.4 | ~1.20.0 | / |
| 5.4.3 | ~1.18.0 &#124;&#124; 1.19.0 | / |

`TC versions (not peer dependencies) ` are compatible with the corresponding GTC version.
However, they were not included in the peer dependencies of the package at the time of release,
`TC versions (not peer dependencies) ` are compatible with the corresponding GTC version.
However, they were not included in the peer dependencies of the package at the time of release,
thus they will trigger a warning during the installation process.
Loading

0 comments on commit f115ec0

Please sign in to comment.