Skip to content

Commit

Permalink
Bump nightwatch and @types/nightwatch (#817)
Browse files Browse the repository at this point in the history
* Bump nightwatch and @types/nightwatch

Bumps [nightwatch](https://github.com/nightwatchjs/nightwatch) and [@types/nightwatch](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/nightwatch). These dependencies needed to be updated together.

Updates `nightwatch` from 2.3.3 to 2.5.3
- [Release notes](https://github.com/nightwatchjs/nightwatch/releases)
- [Commits](nightwatchjs/nightwatch@v2.3.3...v2.5.3)

Updates `@types/nightwatch` from 2.3.6 to 2.3.14
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/nightwatch)

---
updated-dependencies:
- dependency-name: nightwatch
  dependency-type: direct:development
  update-type: version-update:semver-minor
- dependency-name: "@types/nightwatch"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update nightwatch-saucelabs-endsauce to v2.1.0

* Upgrade dependencies

* Fix bug

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kenta Moriuchi <moriken@kimamass.com>
  • Loading branch information
dependabot[bot] and petamoriken committed Dec 7, 2022
1 parent f6b98f6 commit 554d3c0
Show file tree
Hide file tree
Showing 3 changed files with 666 additions and 645 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"@babel/cli": "^7.19.3",
"@babel/core": "^7.20.5",
"@babel/plugin-transform-modules-commonjs": "^7.19.6",
"@types/nightwatch": "^2.3.6",
"@types/nightwatch": "^2.3.15",
"babel-plugin-replace-import-extension": "^1.1.3",
"browserslist": "^4.21.4",
"concurrently": "^7.6.0",
Expand All @@ -88,8 +88,8 @@
"find-unused-exports": "^5.0.0",
"http-server": "^14.1.1",
"mocha": "^10.1.0",
"nightwatch": "^2.3.3",
"nightwatch-saucelabs-endsauce": "^2.0.0",
"nightwatch": "^2.5.3",
"nightwatch-saucelabs-endsauce": "^2.1.0",
"nyc": "^15.1.0",
"power-assert": "^1.4.2",
"rollup": "^3.6.0",
Expand Down
35 changes: 18 additions & 17 deletions test/browser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,33 @@ const { TARGET_URL } = process.env;
/** @type {import("nightwatch").NightwatchTestFunctions} */
module.exports = {
/** @param {import("nightwatch").NightwatchBrowser} client */
["Browser Test"](client) {
client.url(TARGET_URL || "http://127.0.0.1:8000/power.html")
.waitForElementPresent("#mocha-report .suite:nth-of-type(4)", 30000)
.elements("css selector", "#mocha-report .test .error", async (result) => {
async ["Browser Test"](client) {
try {
const result = await new Promise((resolve) => {
client.url(TARGET_URL || "http://127.0.0.1:8000/power.html")
.waitForElementPresent("#mocha-report .suite:nth-of-type(4)", 30000)
.elements("css selector", "#mocha-report .test .error", resolve);
});

// unexpected error
client.verify.ok(result.status === 0, "Check unexpected error");
if (result.status === 0) {
if (result.status !== 0) {
throw result.value;
}

const success = result.value == null || result.value.length === 0;
client.verify.ok(success, "Check error elements");
if (success) {
return;
}

// show error log
for (const element of result.value) {
const { value: error } = await client.elementIdText(element.ELEMENT);
client.verify.ok(false, `\n\n${red}${error}${reset}\n\n`);
if (!success) {
for (const element of result.value) {
const { value: error } = await client.elementIdText(element.ELEMENT);
client.verify.ok(false, `\n\n${red}${error}${reset}\n\n`);
}
}
});
},

afterEach(client) {
client.endSauce();
client.end();
} finally {
client.endSauce();
client.end();
}
},
};
Loading

0 comments on commit 554d3c0

Please sign in to comment.