codeceptjs 4.1.0 → 4.2.0-beta.2
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.
- package/docs/advanced.md +1 -1
- package/docs/alternative-browsers.md +153 -0
- package/docs/basics.md +9 -1
- package/docs/configuration.md +2 -0
- package/docs/helpers/CDPBrowser.md +2138 -0
- package/docs/helpers/Kitesurf.md +118 -0
- package/docs/helpers/Obscura.md +210 -0
- package/docs/helpers/Playwright.md +5 -2
- package/docs/migration-4.md +3 -1
- package/docs/parallel.md +10 -0
- package/docs/plugins/screencast.md +18 -13
- package/docs/plugins.md +1 -1
- package/lib/command/info.js +11 -3
- package/lib/command/workers/runTests.js +14 -20
- package/lib/container.js +6 -0
- package/lib/data/context.js +7 -5
- package/lib/element/WebElement.js +5 -0
- package/lib/helper/Appium.js +14 -2
- package/lib/helper/CDPBrowser.js +3004 -0
- package/lib/helper/Kitesurf.js +139 -0
- package/lib/helper/Obscura.js +344 -0
- package/lib/helper/Playwright.js +41 -10
- package/lib/helper/Puppeteer.js +30 -7
- package/lib/helper/WebDriver.js +27 -6
- package/lib/helper/clientscripts/cdpBrowserClient.js +486 -0
- package/lib/helper/clientscripts/xpathPolyfill.js +31 -0
- package/lib/helper/errors/MultipleElementsFound.js +60 -3
- package/lib/helper/extras/CDPConnection.js +92 -0
- package/lib/helper/extras/CDPElementHandle.js +27 -0
- package/lib/helper/extras/PlaywrightLocator.js +2 -2
- package/lib/helper/extras/apngAssembler.js +156 -0
- package/lib/html.js +9 -2
- package/lib/listener/retryEnhancer.js +2 -1
- package/lib/listener/steps.js +8 -0
- package/lib/locator.js +7 -2
- package/lib/mocha/asyncWrapper.js +7 -1
- package/lib/mocha/hooks.js +10 -0
- package/lib/parser.js +14 -2
- package/lib/plugin/junitReporter.js +17 -1
- package/lib/plugin/screencast.js +116 -24
- package/lib/step/base.js +15 -3
- package/lib/step/config.js +1 -0
- package/lib/store.js +6 -0
- package/lib/utils/loaderCheck.js +6 -0
- package/lib/utils.js +1 -1
- package/lib/workers.js +17 -0
- package/package.json +5 -2
- package/typings/promiseBasedTypes.d.ts +1835 -0
- package/typings/types.d.ts +1848 -0
package/lib/helper/Appium.js
CHANGED
|
@@ -978,11 +978,23 @@ class Appium extends Webdriver {
|
|
|
978
978
|
*/
|
|
979
979
|
async setNetworkConnection(value) {
|
|
980
980
|
onlyForApps.call(this, supportedPlatform.android)
|
|
981
|
-
|
|
981
|
+
const connectivity = {
|
|
982
982
|
airplaneMode: !!(value & 1),
|
|
983
983
|
wifi: !!(value & 2),
|
|
984
984
|
data: !!(value & 4),
|
|
985
|
-
}
|
|
985
|
+
}
|
|
986
|
+
// `mobile: setConnectivity` runs `adb shell svc data <state>` for every field it receives,
|
|
987
|
+
// which fails with "Can't find service: phone" on images without telephony (e.g. tablets).
|
|
988
|
+
// Only a positive result is cached: a freshly booted device may not have registered a carrier
|
|
989
|
+
// yet, and caching that would strip `data` for the whole session.
|
|
990
|
+
if (!this._hasTelephony) {
|
|
991
|
+
const deviceInfo = await this.browser.execute('mobile: deviceInfo')
|
|
992
|
+
this._hasTelephony = !!deviceInfo?.carrierName
|
|
993
|
+
}
|
|
994
|
+
// Keep `data` on telephony-capable devices, otherwise the device stays online over cellular
|
|
995
|
+
// and going offline silently does nothing.
|
|
996
|
+
if (!this._hasTelephony) delete connectivity.data
|
|
997
|
+
return this.browser.execute('mobile: setConnectivity', connectivity)
|
|
986
998
|
}
|
|
987
999
|
|
|
988
1000
|
/**
|