Repository navigation
Fix Jest and WebdriverIO examples (README commands failed) - #1
Merged
Merged
Conversation
- Jest: credentials in the wss:// userinfo were rejected ('Missing key or
secret'); pass them in tb:options like the Puppeteer examples. Replace
selectors that no longer exist on testingbot.com (.navbar-brand,
.features). Guard browser.close() in afterAll.
- WebdriverIO: specs path is resolved relative to the config file, so
'./examples/webdriverio/test.js' matched nothing; add the missing
@wdio/testingbot-service dependency; same selector fixes.
There was a problem hiding this comment.
🟢 Approved
The reviewed changes address the documented authentication, file-path, selector, dependency, and cleanup problems, with no active review issues remaining.
No open issues 🎉
What changed in this PR
This pull request fixes the Jest and WebdriverIO examples so the documented commands authenticate with TestingBot, locate the correct test files, and use current website selectors.
Changes:
- Passes Jest credentials through encoded TestingBot capabilities and safely closes the browser.
- Updates Jest and WebdriverIO selectors for the current TestingBot site.
- Adds the WebdriverIO TestingBot service dependency.
- Corrects the WebdriverIO config-relative spec path and refreshes the lockfile.
| File | Description |
|---|---|
package.json |
Adds the WebdriverIO TestingBot service dependency. |
package-lock.json |
Locks the new service and dependency tree. |
examples/webdriverio/wdio.conf.js |
Corrects spec resolution relative to the configuration file. |
examples/webdriverio/test.js |
Updates website selectors and assertions. |
examples/jest/puppeteer.test.js |
Uses capability-based credentials, current selectors, and guarded cleanup. |
Review effort: Lite
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of https://testingbot-team.atlassian.net/browse/TB-1008 (docs audit). This repo is the Puppeteer sample project in the signup onboarding.
Results running the README in a clean
node:22-bookworm-slimcontainer (before this PR)npm run test:puppeteer:chromenpm run test:puppeteer:edgenpm run test:puppeteer:firefoxTargetCloseError: Protocol error (Target.getBrowserContexts): Target closed(not fixed here, see below)npm run test:jestProtocolError: ... Missing key or secretnpm run test:webdriveriopattern ./examples/webdriverio/test.js did not match any fileandCouldn't find plugin "testingbot" serviceChanges
wss://key:secret@...are not accepted by the endpoint; pass them intb:optionsvia?capabilities=(same as the Puppeteer examples). Replaced selectors that no longer exist on testingbot.com (.navbar-brand,.features) with.navigation spananda[href="/features"]. Guardedbrowser.close().specsis resolved relative to the config file, so it is now./test.js. Added the missing@wdio/testingbot-service(^9.33.1, same major as the other wdio packages). Same selector fixes.Verification (after)
Not fixed: Firefox
test:puppeteer:firefoxfails on the TestingBot side. I tried puppeteer-core 24.8.2 and 25.16.0,browserVersionlatest and 128, andprotocol: 'webDriverBiDi'. CDP fails withTarget closed; BiDi hangs until a 120 s timeout. The /support/web-automate/puppeteer Firefox tab uses the same pattern. This is flagged on TB-1008 as a platform issue, so the example is left unchanged.