webdriverio / appium-boilerplate Goto Github PK
View Code? Open in Web Editor NEWBoilerplate project to run WebdriverIO tests with Appium to test native applications on iOS and Android
License: MIT License
Boilerplate project to run WebdriverIO tests with Appium to test native applications on iOS and Android
License: MIT License
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
### I have my hybrid app running working fine. but when i click login button, it opens another windows for iDP login in browser. and i need to eneter the value over there and also back again to the app.
*Describe the solution you'd like*
A clear and concise description of what you want to happen.
i have a situation where , my app opens a webpage different from my app(browsers), how to handle those elements in that webpage and then back to the original app after login as its a idp page.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Hi guys,
Thank you for provide us this Boilerplate project. I really appreciate it. I have read in 'Locator strategy for native apps' section in README.md that said 'The locator strategy for this boilerplate is to use accessibilityID's'.
I have read your code and I assume that element selector defined in screenobjects folder (for example: forms.screen.js)
const SELECTORS = {
FORMS_SCREEN: '~Forms-screen',
INPUT: '~text-input',
INPUT_TEXT: '~input-text-result',
SWITCH: '~switch',
SWITCH_TEXT: '~switch-text',
DROP_DOWN: '~select-Dropdown',
ACTIVE_BUTTON: '~button-Active',
IN_ACTIVE_BUTTON: '~button-Inactive',
};
What if using resource-id? How to define the selector? Is there any short way like accessibilityID?
Thank you.
Environment (please complete the following information):
Hi there :)
Problem description:
I am exploring this project and find the noReset on the config. I found that config only affect between test file, not between every testcase run. I have tried using driver.reset() in beforeEach and also tried in afterEach, it works on the app but in the console the execution time never stop.
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
In order to make every testcase should be independent (one test have no dependency on another test/previous test), I would like to propose something configuration like resetBetweenTest.
Thank you very much, this project really help my work :)
Am I missing something?
Test Suites: 0 passed, 6 failed, 6 total (100% completed)
Time: π 6.75s
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] android.app: wdio ./config/wdio.android.app.conf.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] android.app script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
*i am not able to execute this boilerplate in the Ios simulator?
I installed all the packages and executing the npm script ios.app but not able to connect to my simulator and not able to open webdrverio app on the simulator.
this is the wdio.ios.app.conf.js
'appium:deviceName': 'iPhone 8',
'appium:platformVersion': '14.2',
'appium:udid':'57BCE496-5E04-4DB3-9E39-8F65F96709E0',
'appium:orientation': 'PORTRAIT',
// automationName
will be mandatory, see
// https://github.com/appium/appium/releases/tag/v1.13.0
'appium:automationName': 'XCUITest',
// The path to the app
'appium:app': join(process.cwd(), './apps/iOS-Simulator-NativeDemoApp-0.2.1.app.zip'),
// Read the reset strategies very well, they differ per platform, see
// http://appium.io/docs/en/writing-running-appium/other/reset-strategies/
'appium:noReset': true,
'appium:newCommandTimeout': 240,
If it's about a specific piece of code, try and include some of it to support your question.
[...]
Environment :
Appium Server LOGS
{"capabilities":{"alwaysMatch":{"platformName":"iOS","appium:deviceName":"iPhone 8","appium:platformVersion":"14.2","appium:udid":"57BCE496-5E04-4DB3-9E39-8F65F96709E0","appium:orientation":"PORTRAIT","appium:automationName":"XCUITest","appium:app":"/Users/square63/Downloads/appium-boilerplate-master/apps/iOS-Simulator-NativeDemoApp-0.2.1.app.zip","appium:noReset":true,"appium:newCommandTimeout":240},"firstMatch":[{}]},"desiredCapabilities":{"platformName":"iOS","appium:deviceName":"iPhone 8","appium:platformVersion":"14.2","appium:udid":"57BCE496-5E04-4DB3-9E39-8F65F96709E0","appium:orientation":"PORTRAIT","appium:automationName":"XCUITest","appium:app":"/Users/square63/Downloads/appium-boilerplate-master/apps/iOS-Simulator-NativeDemoApp-0.2.1.app.zip","appium:noReset":true,"appium:newCommandTimeout":240}}
[HTTP] No route found. Setting content type to 'text/plain'
[HTTP] <-- POST /session 404 1 ms - 50
Environment (please complete the following information):
Node.js version: 17.6.0 <- (super important) (also 17.0.0)
NPM version: 8.5.1
Platform: Android
Platform version: 10
Emulator/Simulator/Real Device: Emulator
mac os Big Sur
version 11.6.4
m1, 2020
Describe the bug
Super simple. node version 16.14.0 is compatibile with appium... 17.6.0 is not. I'm guessing this is a duplicate somewhere in the appium repo. Although this is more an issue with appium and less an issue with this repo i thought they were related so i would bring it up here.
To Reproduce
pull down repo
install appium using node 17.6.0
npm i -g appium
install an avd android device
in the repo
npm i
hook up environment variables to your device and its info
put the app apk in the apps folder (Android-NativeDemoApp-0.4.0.apk
then
run
npm run android.app
the reason i suspect node is the issue is because i did all the steps except with node 16.14.0 and everything worked fine.
don't expect the bug to be fixed by this repo... just wanted to report it to help out the next person that may have struggled with this.
Expected behavior
passing a test.. with proper session startup
Screenshots
If applicable, add screenshots to help explain your problem.
β npm run android.app
> [email protected] android.app
> logLevel=debug wdio config/wdio.android.app.conf.ts
config {
path: '/wd/hub',
runner: 'local',
specs: [],
capabilities: [],
logLevel: 'debug',
bail: 0,
baseUrl: 'http://the-internet.herokuapp.com',
waitforTimeout: 45000,
connectionRetryTimeout: 120000,
connectionRetryCount: 3,
services: [ [ 'appium', [Object] ] ],
framework: 'mocha',
reporters: [ 'spec' ],
mochaOpts: { ui: 'bdd', timeout: 180000 },
host: 'localhost',
port: 4723
}
config services [ [ 'appium', { command: 'appium', args: [Object] } ] ]
config capabilities [
{
platformName: 'Android',
maxInstances: 1,
'appium:deviceName': 'emulator-5554',
'appium:platformVersion': '10',
'appium:orientation': 'PORTRAIT',
'appium:automationName': 'UiAutomator2',
'appium:app': '/Users/user/appium-boilerplate/apps/Android-NativeDemoApp-0.4.0.apk',
'appium:appWaitActivity': 'com.wdiodemoapp.MainActivity',
'appium:noReset': true,
'appium:newCommandTimeout': 240
}
]
Execution of 1 workers started at 2022-03-03T18:36:34.564Z
2022-03-03T18:36:34.564Z DEBUG @wdio/utils:initialiseServices: initialise service "appium" as NPM package
2022-03-03T18:36:34.569Z INFO @wdio/cli:launcher: Run onPrepare hook
2022-03-03T18:36:34.569Z DEBUG @wdio/appium-service: Will spawn Appium process: appium --base-path / --relaxed-security
2022-03-03T18:36:35.010Z DEBUG @wdio/appium-service: Appium started with ID: 6097
2022-03-03T18:36:35.011Z DEBUG @wdio/cli:utils: Finished to run "onPrepare" hook in 442ms
2022-03-03T18:36:35.011Z INFO @wdio/cli:launcher: Run onWorkerStart hook
2022-03-03T18:36:35.012Z DEBUG @wdio/cli:utils: Finished to run "onWorkerStart" hook in 0ms
2022-03-03T18:36:35.012Z INFO @wdio/local-runner: Start worker 0-0 with arg: config/wdio.android.app.conf.ts
[0-0] 2022-03-03T18:36:35.170Z INFO @wdio/local-runner: Run worker command: run
[0-0] 2022-03-03T18:36:35.243Z DEBUG @wdio/config:utils: Found 'ts-node' package, auto-compiling TypeScript files
[0-0] config {
[0-0] path: '/wd/hub',
[0-0] runner: 'local',
[0-0] specs: [],
[0-0] capabilities: [],
[0-0] logLevel: 'debug',
[0-0] bail: 0,
[0-0] baseUrl: 'http://the-internet.herokuapp.com',
[0-0] waitforTimeout: 45000,
[0-0] connectionRetryTimeout: 120000,
[0-0] connectionRetryCount: 3,
[0-0] services: [ [ 'appium', [Object] ] ],
[0-0] framework: 'mocha',
[0-0] reporters: [ 'spec' ],
[0-0] mochaOpts: { ui: 'bdd', timeout: 180000 },
[0-0] host: 'localhost',
[0-0] port: 4723
[0-0] }
[0-0] config services [ [ 'appium', { command: 'appium', args: [Object] } ] ]
[0-0] config capabilities [
[0-0] {
[0-0] platformName: 'Android',
[0-0] maxInstances: 1,
[0-0] 'appium:deviceName': 'emulator-5554',
[0-0] 'appium:platformVersion': '10',
[0-0] 'appium:orientation': 'PORTRAIT',
[0-0] 'appium:automationName': 'UiAutomator2',
[0-0] 'appium:app': '/Users/user/appium-boilerplate/apps/Android-NativeDemoApp-0.4.0.apk',
[0-0] 'appium:appWaitActivity': 'com.wdiodemoapp.MainActivity',
[0-0] 'appium:noReset': true,
[0-0] 'appium:newCommandTimeout': 240
[0-0] }
[0-0] ]
[0-0] 2022-03-03T18:36:35.294Z DEBUG @wdio/local-runner:utils: init remote session
[0-0] 2022-03-03T18:36:35.296Z DEBUG @wdio/utils:initialiseServices: initialise service "appium" as NPM package
[0-0] RUNNING in Android - /tests/specs/app.login.spec.ts
[0-0] 2022-03-03T18:36:35.427Z DEBUG @wdio/local-runner:utils: init remote session
[0-0] 2022-03-03T18:36:35.427Z INFO webdriver: Initiate new session using the WebDriver protocol
[0-0] 2022-03-03T18:36:35.450Z INFO webdriver: [POST] http://localhost:4723/session
[0-0] 2022-03-03T18:36:35.450Z INFO webdriver: DATA {
[0-0] capabilities: {
[0-0] alwaysMatch: {
[0-0] platformName: 'Android',
[0-0] 'appium:deviceName': 'emulator-5554',
[0-0] 'appium:platformVersion': '10',
[0-0] 'appium:orientation': 'PORTRAIT',
[0-0] 'appium:automationName': 'UiAutomator2',
[0-0] 'appium:app': '/Users/user/appium-boilerplate/apps/Android-NativeDemoApp-0.4.0.apk',
[0-0] 'appium:appWaitActivity': 'com.wdiodemoapp.MainActivity',
[0-0] 'appium:noReset': true,
[0-0] 'appium:newCommandTimeout': 240
[0-0] },
[0-0] firstMatch: [ {} ]
[0-0] },
[0-0] desiredCapabilities: {
[0-0] platformName: 'Android',
[0-0] 'appium:deviceName': 'emulator-5554',
[0-0] 'appium:platformVersion': '10',
[0-0] 'appium:orientation': 'PORTRAIT',
[0-0] 'appium:automationName': 'UiAutomator2',
[0-0] 'appium:app': '/Users/user/appium-boilerplate/apps/Android-NativeDemoApp-0.4.0.apk',
[0-0] 'appium:appWaitActivity': 'com.wdiodemoapp.MainActivity',
[0-0] 'appium:noReset': true,
[0-0] 'appium:newCommandTimeout': 240
[0-0] }
[0-0] }
[0-0] 2022-03-03T18:36:35.460Z ERROR webdriver: RequestError: connect ECONNREFUSED ::1:4723
[0-0] at ClientRequest.<anonymous> (/Users/user/appium-boilerplate/node_modules/got/dist/source/core/index.js:962:111)
[0-0] at Object.onceWrapper (node:events:642:26)
[0-0] at ClientRequest.emit (node:events:539:35)
[0-0] at ClientRequest.emit (node:domain:475:12)
[0-0] at ClientRequest.origin.emit (/Users/user/appium-boilerplate/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)
[0-0] at Socket.socketErrorListener (node:_http_client:442:9)
[0-0] at Socket.emit (node:events:527:28)
[0-0] at Socket.emit (node:domain:475:12)
[0-0] at emitErrorNT (node:internal/streams/destroy:164:8)
[0-0] at emitErrorCloseNT (node:internal/streams/destroy:129:3)
[0-0] at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1158:16)
[0-0] 2022-03-03T18:36:35.460Z ERROR @wdio/runner: Error: Failed to create session.
[0-0] Unable to connect to "http://localhost:4723/", make sure browser driver is running on that address.
[0-0] If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
[0-0] at startWebDriverSession (/Users/user/appium-boilerplate/node_modules/webdriver/build/utils.js:72:15)
[0-0] at processTicksAndRejections (node:internal/process/task_queues:96:5)
[0-0] at async Function.newSession (/Users/user/appium-boilerplate/node_modules/webdriver/build/index.js:42:45)
[0-0] at async remote (/Users/user/appium-boilerplate/node_modules/webdriverio/build/index.js:73:22)
[0-0] at async Runner._startSession (/Users/user/appium-boilerplate/node_modules/@wdio/runner/build/index.js:223:56)
[0-0] at async Runner._initSession (/Users/user/appium-boilerplate/node_modules/@wdio/runner/build/index.js:176:25)
[0-0] at async Runner.run (/Users/user/appium-boilerplate/node_modules/@wdio/runner/build/index.js:88:19)
2022-03-03T18:36:35.575Z DEBUG @wdio/local-runner: Runner 0-0 finished with exit code 1
[0-0] FAILED in Android - /tests/specs/app.login.spec.ts
2022-03-03T18:36:35.576Z INFO @wdio/cli:launcher: Run onComplete hook
2022-03-03T18:36:35.576Z DEBUG @wdio/appium-service: Appium (pid: 6097) killed
2022-03-03T18:36:35.576Z DEBUG @wdio/cli:utils: Finished to run "onComplete" hook in 0ms
Spec Files: 0 passed, 1 failed, 1 total (100% completed) in 00:00:01
2022-03-03T18:36:35.577Z INFO @wdio/local-runner: Shutting down spawned worker
2022-03-03T18:36:35.834Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully
2022-03-03T18:36:35.835Z INFO @wdio/local-runner: shutting down
Additional context
nope! thanks for all you maintainers do!
Is your feature request related to a problem? Please describe.
There is a method on driver() called keys() that allows one to send a string via the keyboard to an app. This receives a format error from the Appium server. But presenting the same key sequence as performActions keyDown keyUp works.
Describe the solution you'd like
A new method specifically for keyboard input. I will try and add it as a Custom Command.
Describe alternatives you've considered
Adding it directly to the driver is a bit disruptive.
Additional context
Keyboard input by performActions does not have to address a field. Keyboard input does not work for some Apps in Appium Inspector.
Describe your question with as much detail as possible
Hello. I'm new to using WebDriverIO. For the moment i'm trying to configure the boilerplate for V7 version. On V6 (this one seems to work), but when i switch it to the new version it is stuck in create session (app starts, session is created but if froze into that state).
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
[Appium] New AndroidUiautomator2Driver session created successfully, session 134c6814-b8c0-456d-a5e3-c2d7374906cf added to master session list [debug] [BaseDriver] Event 'newSessionStarted' logged at 1614064639111 (09:17:19 GMT+0200 (Eastern European Standard Time)) [debug] [W3C (134c6814)] Cached the protocol value 'W3C' for the new session 134c6814-b8c0-456d-a5e3-c2d7374906cf [debug] [W3C (134c6814)] Responding to client with driver.createSession() result: {"capabilities":{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"Android","deviceName":"HT8281A03687","platformVersion":"11","orientation":"PORTRAIT","automationName":"UiAutomator2","app":"/Users/Shared/Framework/automationUniversity/apps/myapp.apk","noReset":true,"newCommandTimeout":240},"platformName":"Android","deviceName":"HT8281A03687","platformVersion":"11","orientation":"PORTRAIT","automationName":"UiAutomator2","app":"/Users/Shared/Framework/automationUniversity/apps/myapp.apk","noReset":true,"newCommandTimeout":240,"deviceUDID":"HT8281A03687","appPackage":"com.myapp.flynet","deviceApiLevel":30,"deviceScreenSize":"1080x1920","deviceScreenDensity":420,"deviceModel":"Pixel 2","deviceManufacturer":"Google","pixelRatio":2.625,"statBarHeight":63,"viewportRect":{"left":0,"top":63,"width":1080,"heigh... [HTTP] <-- POST /wd/hub/session 200 7902 ms - 1092 [HTTP]
Do i need to do something extra?
I will put here my dependencies:
"devDependencies": { "@babel/register": "^7.12.13", "@wdio/allure-reporter": "^7.0.7", "@wdio/appium-service": "^7.0.7", "@wdio/cli": "^7.0.7", "@wdio/local-runner": "^7.0.7", "@wdio/mocha-framework": "^7.0.7", "@wdio/selenium-standalone-service": "^7.0.7", "@wdio/spec-reporter": "^7.0.7", "@wdio/sync": "^7.0.7", "appium": "^1.20.2", "chai": "^4.3.0" }
Describe your question with as much detail as possible
A clear and concise question that doesn't require too much conversation. Need more help? Find me on Gitter
I downloaded the repo and the project, did npm install.
But unable to run the project,
Do i have to stick to webdriverIO version 5 , because i updated to version 6.
If it's about a specific piece of code, try and include some of it to support your question.
[...]
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
I am getting the error in setvalue method for Android Dropdown.
v5
Error: element ("//android.widget.ListView") still not existing after 10000ms
Environment (please complete the following information):
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Describe your question with as much detail as possible
A clear and concise question that doesn't require too much conversation. Need more help? Find me on Gitter
If it's about a specific piece of code, try and include some of it to support your question.
[...]
node --version
v10.15.3
NPM --version
6.9.0
appium --version
1.14.2
WebdriverIO: 5.12.4
Platform: [Android]
Real Device.
Cloned project from boilerplate and copied .apk file in .apps directory and when running
npm run android.app
getting below errors..
events.js:174
throw er; // Unhandled 'error' event
^
Error: spawn appium ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:757:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
[... lines matching original stack trace ...]
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] android.app: wdio ./config/wdio.android.app.conf.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] android.app script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output abov
Hello @wswebcreation
Can you add a feature of parallel execution for the following combinations?
Run test suites on android different browsers like 'chrome','firefox','Edge'
Run test suites on android on same browser like chrome ,β¦
same way for iOS
it could help us to implement in our framework.
Thanks In Advance.
Describe your question with as much detail as possible
A clear and concise question that doesn't require too much conversation. Need more help? Find me on Gitter
Hi there,
I repo the appium-biolerplate and installed as the ReadMe suggested. My question is how I could run a single test not multiple tests. I tried to add "--spec"/"--exclude" [file name] to filter the test I want to test, but either of them worked.
If it's about a specific piece of code, try and include some of it to support your question.
[$npm run ios.browser //it will test 4 files.
I tried to run npm run ios.browser --spec browser.checkbox.spec.js
, but it still will run 4 files to test. I also tried to run npm run ios.browser --exclude browser.checkbox.spec.js
, and it will run 4 files to test as well.
]
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
Environment (please complete the following information):
Describe the bug
Getting error "Cannot use import statement outside a module" when running sample code under /examples/pageobject
> @ test /Users/phampp/Downloads/webdriverio/examples/pageobject
> ../../packages/wdio-cli/bin/wdio.js ./wdio.conf.js
Execution of 1 spec files started at 2020-04-14T07:55:43.791Z
[0-0] RUNNING in chrome - /specs/dynamic.spec.js
[0-0] Error: Failed to create session.
Unexpected token < in JSON at position 0 in "http://localhost:4444/session"
[0-0] FAILED in chrome - /specs/dynamic.spec.js
Spec Files: 0 passed, 1 failed, 1 total (100% completed) in 00:00:02
npm ERR! Test failed. See above for more details.
To Reproduce
git clone [email protected]:webdriverio/webdriverio.git
cd ./webdriverio
npm install
npm run setup
cd examples/pageobject/
npm test
After this, it failed with the above error
Expected behavior
Tests should run successfully
Hi,
So i've just started playing around with this repos. I was able to run it once on an emulator but now everytime i run it i get the following error
[0-0] 2021-05-06T13:25:13.770Z ERROR webdriver: RequestError: connect ECONNREFUSED 127.0.0.1:4723
at ClientRequest.<anonymous> (C:\code\appium-boilerplate-main_1\node_modules\got\dist\source\core\index.js:956:111)
at Object.onceWrapper (events.js:418:26)
at ClientRequest.emit (events.js:323:22)
at ClientRequest.EventEmitter.emit (domain.js:482:12)
at ClientRequest.origin.emit (C:\code\appium-boilerplate-main_1\node_modules\@szmarczak\http-timer\dist\source\index.js:39:20)
at Socket.socketErrorListener (_http_client.js:426:9)
at Socket.emit (events.js:311:20)
at Socket.EventEmitter.emit (domain.js:482:12)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16)
[0-0] 2021-05-06T13:25:13.770Z ERROR @wdio/runner: Error: Failed to create session.
Unable to connect to "http://localhost:4723/", make sure browser driver is running on that address.
If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
at Object.startWebDriverSession (C:\code\appium-boilerplate-main_1\node_modules\webdriver\build\utils.js:34:15)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
[0-0] FAILED in Android - C:\code\appium-boilerplate-main_1\tests\specs\app.webview.spec.js
I am attempting to run the Android app script using the following command
npm run android.app
I have tried to delete the code repo and reinstalling the code but i still get the same issue. I have also restarted my machine. I dont know how to debug this issue. Could someone please assist? I am unsure how to debug the app.
I have only just set up my machine for attempting to test with Mobile devices. Things I have done
On a Windows 10 machine and using VS Code as my IDE
npm install appium -g
)npm install appium-doctor -g
)npm install
Environment:
Additional context
config in wdio.android.app.conf.js
const { join } = require('path');
const { config } = require('./wdio.shared.conf');
config.specs = [
'./tests/specs/**/app.webview.spec.js',
];
config.capabilities = [
{
platformName: 'Android',
maxInstances: 1,
'appium:deviceName': 'Pixel_3a_API_30_x86',
'appium:platformVersion': '11',
'appium:orientation': 'PORTRAIT',
'appium:automationName': 'UiAutomator2',
'appium:app': join(process.cwd(), './apps/Android-NativeDemoApp-0.2.1.apk'),
'appium:noReset': true,
'appium:newCommandTimeout': 240,
},
];
exports.config = config;
In VS Code, on the package.json file, I hovered my cursor over 'android.app' and clicked the "Debug Script" pop up, but it didnt provide anything different
Environment (please complete the following information):
Describe the bug
appium-boilerplate is not containing related dependency @wdio/cli
to execute any tests from webdriverio
To Reproduce
git clone https://github.com/webdriverio/appium-boilerplate.git
npm install
npm run ios.app
Describe your question with as much detail as possible
As mentioned by title.
I did use the following code on wdio.conf.js, however, it doesn't work.
afterTest: function (test) {
// if (test.error !== undefined && driver !== undefined) {
driver.takeScreenshot();
// driver.saveScreenshot('assertionError_' + assertion.error.message + '.png');
// }
}
Environment (please complete the following information):
Describe the bug
I could not find any wdio related code to click and scroll the dropdown, After selecting the desired value. I want to Click on "Done" button, Need help with it.
To Reproduce
N/A
Expected behavior
User should be able to scroll a dropdown and select the desired value.
Screenshots
Image Attached
Additional context
N/A
Environment:
Describe the bug
I set up this project and when I am trying to run the Android tests, app starts for a moment and then crashes. It happens on both, Real and virtual devices. Logs in appium server saying:
"[debug] [W3C] Encountered internal error running command: Error: The instrumentation process cannot be initialized. Make sure the application under test does not crash and investigate the logcat output."
When I open app manually on AVD/Real Device it works fine.
Appium Server logs
Appium Logs.txt
Hello,
I have done :
But I can't run ios test well, here is my wdio.ios.app.conf.ts
import { join } from 'path';
import config from './wdio.shared.local.appium.conf';
// ============
// Specs
// ============
config.specs = [
'./tests/specs/app-ios.openapp.spec.ts',
];
// ============
// Capabilities
// ============
// For all capabilities please check
// http://appium.io/docs/en/writing-running-appium/caps/#general-capabilities
config.capabilities = [
{
// The defaults you need to have in your config
platformName: 'iOS',
maxInstances: 1,
logLevel: 'debug',
// For W3C the appium capabilities need to have an extension prefix
// This is `appium:` for all Appium Capabilities which can be found here
// http://appium.io/docs/en/writing-running-appium/caps/
'appium:deviceName': 'iPhone6sp',
'appium:platformVersion': '10.0',
'appium:orientation': 'PORTRAIT',
'appium:automationName': 'XCUITest',
// The path to the app
'appium:app': join(process.cwd(), './apps/XCUITestsDemo.ipa'),
// Read the reset strategies very well, they differ per platform, see
// http://appium.io/docs/en/writing-running-appium/other/reset-strategies/
'appium:noReset': true,
'appium:newCommandTimeout': 240,
},
];
exports.config = config;
Environment :
Additional context
here is a npm error log in the below.
2022-03-29T09_49_57_077Z-debug.log.
please help me to run ios test
How to use multiremote with this boilerplate? I want to have to appium sessions running ( 2 iOS to be more specific)
My configuration is
config.capabilities = [{
practitioner: {
capabilities: {
"deviceName": "iPad Air (4th generation)",
"platformName": "iOS",
"platformVersion": "14.4"
}
},
client: {
capabilities: {
"deviceName": "iPad (8th generation)",
"platformName": "iOS",
"platformVersion": "14.4",
}
}
}]
**Environment
**Additional context
With just one simulator as provided in the boilerplate works fine... but when trying to use the multiremote in the WDIO Testrunner, I get an error saying missing the platformName, but I am sending it inside another object (practitioner and client):
2021-07-11T18:15:22.323Z INFO webdriver: [POST] http://localhost:4723/session
[0-0] 2021-07-11T18:15:22.324Z INFO webdriver: DATA {
capabilities: {
alwaysMatch: { practitioner: [Object], client: [Object] },
firstMatch: [ {} ]
},
desiredCapabilities: {
practitioner: { capabilities: [Object] },
client: { capabilities: [Object] }
}
}
[0-0] 2021-07-11T18:15:22.449Z WARN webdriver: Request failed with status 500 due to An unknown server-side error occurred while processing the command. Original error: You must include a platformName capability
Describe your question with as much detail as possible
I would like to automate a step to press on the Back button (or any buttons) of an Android device. I tried following options but none of them work. Could you please help?
Call "browser.pressKeyCode(4). Error throws "browser.pressKeyCode is not a function"
Call "driver.pressKeyCode(4)". Error throws "driver is not defined"
Appium 1.9.1
webdriverio version 4
If it's about a specific piece of code, try and include some of it to support your question.
Here is my config
capabilities: [{
"platformName": "Android",
"app": "/Users/app/build/outputs/apk/debug/app-debug.apk",
"deviceName": "Pixel_API_27_8.1",
"platformVersion": "8.1",
"noReset": true,
"appWaitActivity": "com.xxxx.cloud.mobile.onboarding.launchscreen.LaunchScreenActivity",
"appActivity": ".logon.LogonActivity",
"automationName": "UiAutomator2",
"avd": "Pixel_API_27_8.1"
}],
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
Can some one help me in verfying IOS Picker wheel values [Drop Down Values]
Hello,
I am trying to automate android browser applications through emulator, I ha configured capabilities, appium server started but it is throwing error like.. No connected devices found
Can you throw some light here to fix this issues?
Environment:
Describe the bug
When running the boilerplate project for android browser or the android app - I get an error
To Reproduce
Nothing i think its environmental but dont know how to fix it. May be worth replicating the environment
Expected behavior
I should be able to run both browser test and app test
Additional context
Add any other context about the problem here.
Describe your question with as much detail as possible
The WebView context does not load in Android, it works in iOS.
If it's about a specific piece of code, try and include some of it to support your question.
iOS output
[0-0] RUNNING in iOS - /tests/specs/app.webview.spec.js
[0-0] [ 'NATIVE_APP' ]
[0-0] [ 'NATIVE_APP', 'WEBVIEW_76375.2' ]
[0-0] [ 'NATIVE_APP', 'WEBVIEW_76375.2' ]
[0-0] [ 'NATIVE_APP', 'WEBVIEW_76375.2' ]
[0-0] [ 'NATIVE_APP', 'WEBVIEW_76375.2' ]
[0-0] [ 'NATIVE_APP', 'WEBVIEW_76375.2' ]
[0-0] PASSED in iOS - /tests/specs/app.webview.spec.js
Android output
[emulator-5554 LINUX 8.0.0 #0-0] 1) WebdriverIO and Appium, when interacting with a WebView, should be able to open call action on the Iframe page
[emulator-5554 LINUX 8.0.0 #0-0] Error: Webview context not loaded
[emulator-5554 LINUX 8.0.0 #0-0] Error: Webview context not loaded
[emulator-5554 LINUX 8.0.0 #0-0] at WebViewScreen.waitForWebViewContextLoaded (/Users/usman.rajab/Desktop/tink/TinkLinkDemo/integration_aws_device_farm/tests/helpers/WebView.js:21:16)
[emulator-5554 LINUX 8.0.0 #0-0] at WebViewScreen.waitForWebsiteLoaded (/Users/usman.rajab/Desktop/tink/TinkLinkDemo/integration_aws_device_farm/tests/helpers/WebView.js:69:14)
[emulator-5554 LINUX 8.0.0 #0-0] at UserContext.beforeEach (/Users/usman.rajab/Desktop/tink/TinkLinkDemo/integration_aws_device_farm/tests/specs/app.webview.spec.js:6:19)
[emulator-5554 LINUX 8.0.0 #0-0] Error: Malformed type for "name" parameter of command switchContext
Expected: string
Actual: undefined
For more info see https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#webviews-and-other-contexts
Environment (please complete the following information):
% npm run android.app -- --spec=tests/specs/app.webview.spec.ts
[email protected] android.app
wdio config/wdio.android.app.conf.ts "--spec=tests/specs/app.webview.spec.ts"
Assertion failed: (thread_id_key != 0x7777), function find_thread_id_key, file ../src/coroutine.cc, line 134.
zsh: abort npm run android.app -- --spec=tests/specs/app.webview.spec.ts
while running any test am getting th above error.
My requirement is : need to automate react app on mobile web browser
can you assist me to run and check the feasibility of this framework?
I have a problem to setup WebdriverIO with Appium for mobile testing so
Is appium-boilerplate is needed for testing mobile applications through webdriverIO?
Environment (please complete the following information):
Environment (please complete the following information):
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Hello,
I have done :
This is My wdio.android.app.conf.ts
import { join } from 'path';
import config from './wdio.shared.local.appium.conf';
// ============
// Specs
// ============
config.specs = [
'./tests/specs/**/app*.spec.ts',
];
// ============
// Capabilities
// ============
// For all capabilities please check
// http://appium.io/docs/en/writing-running-appium/caps/#general-capabilities
config.capabilities = [
{
// The defaults you need to have in your config
platformName: 'Android',
maxInstances: 1,
// For W3C the appium capabilities need to have an extension prefix
// http://appium.io/docs/en/writing-running-appium/caps/
// This is `appium:` for all Appium Capabilities which can be found here
'appium:deviceName': 'device',
//'appium:udid' : 'emulator-5554',
'appium:platformVersion': '11.0',
'appium:orientation': 'PORTRAIT',
'appium:automationName': 'UiAutomator2',
// The path to the app
'appium:app': join(process.cwd(), './apps/Android-NativeDemoApp-0.4.0.apk'),
// @ts-ignore
'appium:appWaitActivity': 'com.wdiodemoapp.MainActivity',
// Read the reset strategies very well, they differ per platform, see
// http://appium.io/docs/en/writing-running-appium/other/reset-strategies/
'appium:noReset': true,
'appium:newCommandTimeout': 240,
},
];
exports.config = config;
Environment (please complete the following information):
Please help and give me best practice to run test
Thank You
Environment (please complete the following information):
Describe the bug
Error: spawn appium ENOENT when test with appium and selenium grid
To Reproduce
1γprepare docker appium/appium and docker selenium/hub in ubuntu 16.04
2γprepare Simulator in windows7 using Nox at https://www.bignox.com/
3γstart docker container and Simulator
4γgit clone https://github.com/webdriverio/appium-boilerplate.git
5γdownload Android-NativeDemoApp-0.2.1.apk in appium-boilerplate/app dir
5γnpm install
6γnpm run android.app
Expected behavior
run appium-boilerplate test successful
Screenshots
below is the appium docker running log
[debug] [GENERIC] Calling AppiumDriver.getStatus() with args: []
[debug] [GENERIC] Responding to client with driver.getStatus() result: {"build":{"version":"1.15.1"}}
[HTTP] <-- GET /wd/hub/status 200 3 ms - 68
[HTTP]
[HTTP] --> GET /wd/hub/status
[HTTP] {}
[debug] [GENERIC] Calling AppiumDriver.getStatus() with args: []
[debug] [GENERIC] Responding to client with driver.getStatus() result: {"build":{"version":"1.15.1"}}
[HTTP] <-- GET /wd/hub/status 200 4 ms - 68
[HTTP]
[HTTP] --> GET /wd/hub/status
[HTTP] {}
[debug] [GENERIC] Calling AppiumDriver.getStatus() with args: []
[debug] [GENERIC] Responding to client with driver.getStatus() result: {"build":{"version":"1.15.1"}}
[HTTP] <-- GET /wd/hub/status 200 2 ms - 68
[HTTP]
[HTTP] --> GET /wd/hub/status
[HTTP] {}
[debug] [GENERIC] Calling AppiumDriver.getStatus() with args: []
[debug] [GENERIC] Responding to client with driver.getStatus() result: {"build":{"version":"1.15.1"}}
[HTTP] <-- GET /wd/hub/status 200 1 ms - 68
[HTTP]
[HTTP] --> GET /wd/hub/status
[HTTP] {}
[debug] [GENERIC] Calling AppiumDriver.getStatus() with args: []
[debug] [GENERIC] Responding to client with driver.getStatus() result: {"build":{"version":"1.15.1"}}
Additional context
root@ubuntu:~/android_auto/appium-boilerplate# npm run android.app
[email protected] android.app /root/android_auto/appium-boilerplate
wdio ./config/wdio.android.app.conf.js
Execution of 6 spec files started at 2020-01-16T05:57:51.393Z
2020-01-16T05:57:51.403Z DEBUG @wdio/utils:initialiseServices: initialise wdio service "appium"
2020-01-16T05:57:51.423Z INFO @wdio/cli:launcher: Run onPrepare hook
2020-01-16T05:57:51.425Z DEBUG @wdio/appium-service: Will spawn Appium process: appium
events.js:167
throw er; // Unhandled 'error' event
^
Error: spawn appium ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:232:19)
at onErrorNT (internal/child_process.js:407:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:238:12)
at onErrorNT (internal/child_process.js:407:16)
[... lines matching original stack trace ...]
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] android.app: wdio ./config/wdio.android.app.conf.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] android.app script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-01-16T05_57_51_467Z-debug.log
I do have a react native application and I want to create a build and run the test cases on the CI/CD pipeline. Is there any documents or way to achieve it. I was referring to Microsoft appcenter CI/CD but they don't provide support for the Webdriver or JS Appium. You can refer to the thread here Let me know if there is any way we can achieve it?
Describe your question with as much detail as possible
Howdy! I think I have config problem, all the tests run fine, except when I import a file from my actual source code. Here's the folder structure we have right now is below(sorry I don't know how to create that beautiful tree) but the e2e and src folder are on the same level and I am importing my strings from localization and using inside the e2e test, my selectors come from the same place.
|-- e2e
|---- login.spec.ts
|-- src
|---- localization
|------ index.ts
|-- tsconfig.json
If it's about a specific piece of code, try and include some of it to support your question.
ts-node
{
"compilerOptions": {
"target": "esnext" ,
"module": "commonjs" ,
"lib": ["es6"] ,
"allowJs": true ,
"sourceMap": true ,
"noEmit": true ,
"isolatedModules": true ,
"skipLibCheck": true,
"strict": true ,
"moduleResolution": "node" ,
"baseUrl": "./src",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"types": ["node", "webdriverio/async", "@wdio/mocha-framework", "expect-webdriverio", "jest"]
},
"exclude": ["node_modules", "babel.config.js", "metro.config.js", "jest.config.js"]
}
babel.config.js
module.exports = {
presets: ['module:metro-react-native-babel-preset', '@babel/preset-typescript'],
plugins: [
[
'module-resolver',
{
extensions: [
'.js',
'.jsx',
'.ts',
'.tsx',
'.android.js',
'.android.tsx',
'.ios.js',
'.ios.tsx',
],
root: ['./src'],
},
],
],
};
WelcomeScreen.ts
import { Strings } from './../../../src/localization/';
import AppScreen from './AppScreen';
class WelcomeScreen extends AppScreen {
constructor() {
super('~Welcome-screen');
}
private get letsGoButton() {
return $(`~${Strings.lets_go_button}`);
}
async tapOnLetsGoButton() {
await this.letsGoButton.click();
}
}
export default new WelcomeScreen();
config.ts
export const config: WebdriverIO.Config = {
runner: 'local',
maxInstances: 1,
specs: [],
capabilities: [],
logLevel: 'trace',
bail: 0,
baseUrl: 'http://localhost',
waitforTimeout: 45000,
connectionRetryTimeout: 120000,
connectionRetryCount: 3,
services: [],
framework: 'mocha',
reporters: ['spec'],
mochaOpts: {
ui: 'bdd',
timeout: 3 * 60 * 1000, // 3min
},
};
The error I am getting:
2021-12-02T21:32:06.768Z WARN @wdio/mocha-framework: Unable to load spec files quite likely because they rely on browser
object that is not fully initialised.
[0-0] browser
object has only capabilities
and some flags like isMobile
.
[0-0] Helper files that use other browser
commands have to be moved to before
hook.
[0-0] Spec file(s): /Users/leonardo.redin/Projects/apppath/app/e2e/tests/specs/login.spec.ts
[0-0] Error: /Users/leonardo.redin/Projects/apppath/app/node_modules/react-native/index.js:14
[0-0] import typeof AccessibilityInfo from './Libraries/Components/AccessibilityInfo/AccessibilityInfo';
[0-0] ^^^^^^
[0-0]
[0-0] SyntaxError: Cannot use import statement outside a module
[0-0] at wrapSafe (internal/modules/cjs/loader.js:979:16)
[0-0] at Module._compile (internal/modules/cjs/loader.js:1027:27)
[0-0] at Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
[0-0] at Object.require.extensions. [as .js] (/Users/leonardo.redin/Projects/apppath/app/node_modules/ts-node/src/index.ts:1355:43)
[0-0] at Module.load (internal/modules/cjs/loader.js:928:32)
[0-0] at Function.Module._load (internal/modules/cjs/loader.js:769:14)
[0-0] at Module.require (internal/modules/cjs/loader.js:952:19)
[0-0] at require (internal/modules/cjs/helpers.js:88:18)
[0-0] at Object. (/Users/leonardo.redin/Projects/apppath/app/node_modules/react-native-localization/lib/LocalizedStrings.js:20:20)
[0-0] at Module._compile (internal/modules/cjs/loader.js:1063:30)
Environment (please complete the following information):
Additional context
As I could see I can run the tsc
command and the app, everything that is inside the src
folder is ok but when importing that file into the e2e
folder makes things break. Maybe I am missing some configuration? Thanks for any help!
Hi Sir,
I see in your config files, no where mentioned HUB ,PORT ..how this framework is handling these ?
and why you declared specifically 'export const config: WebdriverIO.Config = {' in wdio.shared.config β¦do we need to declare like this in V7?
Environment :
Describe the bug
While executing 'npm run android.app' command, I am getting the following error:
9 verbose lifecycle [email protected]android.app: CWD: /Users/saurabhdubey/Downloads/appium-boilerplate-4android.app: Args: [ '-c', 'wdio ./config/wdio.android.app.conf.js' ]
10 silly lifecycle [email protected]
11 silly lifecycle [email protected]android.app: Returned: code: 1 signal: nullandroid.app: Failed to exec android.app script
12 info lifecycle [email protected]
13 verbose stack Error: [email protected] android.app: wdio ./config/wdio.android.app.conf.js
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16)
13 verbose stack at EventEmitter.emit (events.js:159:13)
13 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:159:13)
13 verbose stack at maybeClose (internal/child_process.js:943:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
14 verbose pkgid [email protected]
15 verbose cwd /Users/saurabhdubey/Downloads/appium-boilerplate-4
16 verbose Darwin 18.5.0
17 verbose argv "/usr/local/Cellar/node/9.3.0_1/bin/node" "/usr/local/bin/npm" "run" "android.app"
18 verbose node v9.3.0
19 verbose npm v5.6.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] android.app: wdio ./config/wdio.android.app.conf.js
22 error Exit status 1
23 error Failed at the [email protected] android.app script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Expected behavior
On invoking this command from terminal, the appium service should start and test cases should start executing. It is working fine in v5 of the same project.
Using the main branch of this repo as of eb3ad62 and I kept getting this error while running ios.app script.
2022-03-10T17:26:10.542Z ERROR webdriver: RequestError: connect ECONNREFUSED ::1:4723
at ClientRequest. (./appium-boilerplate/node_modules/got/dist/source/core/index.js:956:111)
at Object.onceWrapper (node:events:640:26)
at ClientRequest.emit (node:events:532:35)
at ClientRequest.emit (node:domain:475:12)
at ClientRequest.origin.emit (./appium-boilerplate/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)
at Socket.socketErrorListener (node:_http_client:442:9)
at Socket.emit (node:events:520:28)
at Socket.emit (node:domain:475:12)
at emitErrorNT (node:internal/streams/destroy:164:8)
at emitErrorCloseNT (node:internal/streams/destroy:129:3)
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16)
2022-03-10T17:26:10.542Z ERROR @wdio/runner: Error: Failed to create session.
Unable to connect to "http://localhost:4723/", make sure browser driver is running on that address.
If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
It looks like the appium service and wdio capabilities default the hostname to 0.0.0.0 and localhost. The fix was to update either the wdio.shared.local.appium.conf.ts with address: "localhost"
as an arg, OR wdio.ios.app.conf.ts with capabilities.hostname = '0.0.0.0
.
Then and only then was I able to get it to work on my mac.
Links to the docs:
https://webdriver.io/docs/options/#capabilities
https://appium.io/docs/en/writing-running-appium/server-args/
WebdriverIO recommends here that you do not start a new project with sync mode anymore, as it is not supported in upcoming Chromium releases. I can go ahead and make a PR converting this project to async mode. Just want the go-ahead
Environment:
Describe the bug
I was facing troubles when tried to run android tests
username@macbook:~/Documents/Learning/appium-boilerplate|mainβ‘ β npm run android.app
> [email protected] android.app /Users/username/Documents/Learning/appium-boilerplate
> wdio config/wdio.android.app.conf.ts
sh: wdio: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! [email protected] android.app: `wdio config/wdio.android.app.conf.ts`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] android.app script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/username/.npm/_logs/2021-10-03T07_49_36_843Z-debug.log
Additional context
It resolved when I added "@wdio/cli": "^7.13.0",
dependency. Was that intended or I missed something with the default config?
Environment (please complete the following information):
Describe the bug
A clear and concise description of what the bug is.
While try to run npm run ios.app
[email protected] ios.app /Users/XXX/Documents/webdriverIO_Appium/appium-boilerplate
wdio ./config/wdio.ios.app.conf.js
Execution of 6 spec files started at 2020-04-08T07:38:30.285Z
[0-0] RUNNING in iOS - /tests/specs/app.forms.spec.js
[0-0] Error: Failed to create session.
read ECONNRESET
[0-0] FAILED in iOS - /tests/specs
To Reproduce
Steps to reproduce the behavior
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Environment (please complete the following information):
Hi,
Newbie to webdriverio, I'm having a bit of trouble getting the boilerplate to run. A little bit of google research tells me this error is saying there is a syntax problem somewhere. I don't see anything sticking out, was hoping that you might have some insight.
Thanks!
What I've done:
What happens:
β ~/Documents/appium-boilerplate* master npm run ios.app
> [email protected] ios.app /Users/eharms/Documents/appium-boilerplate
> wdio ./config/wdio.ios.app.conf.js
Execution of 0 spec files started at 2019-08-06T21:23:00.399Z
events.js:183
throw er; // Unhandled 'error' event
^
Error: spawn appium ENOENT
at _errnoException (util.js:1024:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:372:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickDomainCallback (internal/process/next_tick.js:218:9)
at Function.Module.runMain (module.js:678:11)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] ios.app: `wdio ./config/wdio.ios.app.conf.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] ios.app script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/eharms/.npm/_logs/2019-08-06T21_23_00_433Z-debug.log
My wdio.shared.conf.js
exports.config = {
// ====================
// Runner and framework
// Configuration
// ====================
runner: 'local',
framework: 'jasmine',
jasmineNodeOpts: {
// Updated the timeout to 30 seconds due to possible longer appium calls
// When using XPATH
defaultTimeoutInterval: 90000,
},
sync: true,
logLevel: 'silent',
deprecationWarnings: true,
bail: 0,
baseUrl: 'http://the-internet.herokuapp.com',
waitforTimeout: 10000,
connectionRetryTimeout: 90000,
connectionRetryCount: 3,
reporters: [ 'spec' ],
// ====================
// Appium Configuration
// ====================
services: [ 'appium' ],
appium: {
// For options see
// https://github.com/webdriverio/webdriverio/tree/master/packages/wdio-appium-service
args: {
// For arguments see
// https://github.com/webdriverio/webdriverio/tree/master/packages/wdio-appium-service
},
command: 'appium'
},
port: 4723,
// ====================
// Some hooks
// ====================
beforeSession: (config, capabilities, specs) => {
require('@babel/register');
},
};
My wdio.ios.app.conf.js
const { config } = require('./wdio.shared.conf');
// ============
// Specs
// ============
config.specs = [
'./tests/specs/**/app*.spec.js',
];
// ============
// Capabilities
// ============
// For all capabilities please check
// http://appium.io/docs/en/writing-running-appium/caps/#general-capabilities
config.desiredCapabilities = [
{
// The defaults you need to have in your config
platformName: 'iOS',
maxInstances: 1,
// For W3C the appium capabilities need to have an extension prefix
// This is `appium:` for all Appium Capabilities which can be found here
// http://appium.io/docs/en/writing-running-appium/caps/
'appium:deviceName': 'iPhone X',
'appium:platformVersion': '12.2',
'appium:orientation': 'PORTRAIT',
// `automationName` will be mandatory, see
// https://github.com/appium/appium/releases/tag/v1.13.0
'appium:automationName': 'XCUITest',
// The path to the app
'appium:app': '/Users/eharms/Documents/appium-boilerplate/apps/iOS-Simulator-NativeDemoApp-0.2.1.app',
// Read the reset strategies very well, they differ per platform, see
// http://appium.io/docs/en/writing-running-appium/other/reset-strategies/
// 'appium:noReset': true,
// 'appium:newCommandTimeout': 240,
},
];
exports.config = config;
Environment (please complete the following information):
Describe the bug
Not able to create the session to execute the ios
To Reproduce
config.capabilities = [
{
// The defaults you need to have in your config
platformName: 'iOS',
maxInstances: 1,
// For W3C the appium capabilities need to have an extension prefix
// This is `appium:` for all Appium Capabilities which can be found here
// http://appium.io/docs/en/writing-running-appium/caps/
'appium:deviceName': 'iPhone 11 Pro Max',
'appium:platformVersion': '13.6',
'appium:orientation': 'PORTRAIT',
// `automationName` will be mandatory, see
// https://github.com/appium/appium/releases/tag/v1.13.0
'appium:automationName': 'XCUITest',
// The path to the app
'appium:app': join(
process.cwd(),
'./apps/iOS-Simulator-NativeDemoApp-0.2.1.app.zip'
),
// Read the reset strategies very well, they differ per platform, see
// http://appium.io/docs/en/writing-running-appium/other/reset-strategies/
'appium:noReset': true,
'appium:newCommandTimeout': 240,
},
];
Expected behavior
The Appium session will be created and test will be running
Screenshots
Additional context
Appium 1.17.1
Describe your question with as much detail as possible
A clear and concise question that doesn't require too much conversation. Need more help? Find me on Gitter
I am new, so a foolish question.
Why we need bable.?
If we needs to compiles in ES6 , is there any other tools instead of bable, why we need compiles ES2015+ down to ES5.
If it's about a specific piece of code, try and include some of it to support your question.
[...]
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
I need to discuss in face to face. zoom would it be greate? Please send me a link.
Pre-check
Describe the improvement
I'd like to report
Description of the improvement / report
For someone who is new to mobile testing it would be definitely helpful to find a get started documentation on where to download xCode or Android and how to download and setup a specific iOS/Android version. This doesn't need to be a comprehensive tutorial. A step by step list with links to helpful "Getting Started" docs from other sources should be sufficient.
I just realised this when trying to start the test and have seen that I don't have the expected iOS version installed as defined in the wdio.conf.
Hello
we are planning to automated our application on mobile browsers and choose WebdriverIO as framework, which is new to us
suppose , I have a ebook, I want turn pages 1-2, 2-3 like but I see browser.swipeRight but while execution it says browser.swipeRight is not a function
is there any way to swipe pages , we have option several options to turn pages like when user swap or when user tap on the screen <left/right side of the page not in the middle>
can you help to handle this scenario?
Platform: Mobile chrome browser
After writing the code
driver.waitUntil(() => {
// Get all the contexts, that could look like this
const contexts = driver.getContexts();
// Log them to the console
console.log('contexts = ', contexts);
// Just return false so this function will never return a truthy value
return false;
}, 15000);
The out puts are always
[0-0] contexts = [
'NATIVE_APP',
'WEBVIEW_10504.11',
'WEBVIEW_25791.1',
'WEBVIEW_25791.2'
]
[0-0] contexts = [
'NATIVE_APP',
'WEBVIEW_10504.11',
'WEBVIEW_25791.1',
'WEBVIEW_25791.2'
]
[0-0] contexts = [
'NATIVE_APP',
'WEBVIEW_10504.11',
'WEBVIEW_25791.1',
'WEBVIEW_25791.2'
]
[0-0] contexts = [
'NATIVE_APP',
'WEBVIEW_10504.11',
'WEBVIEW_25791.1',
'WEBVIEW_25791.2'
]
Then how to track what browsers its opening
my config has 'appium:includeSafariInWebviews': 'true',
Hello when I try run tests. I get error
appium-boilerplate (main) $ npm run ios.app
[email protected] ios.app /Users/useName/Projects/appium-boilerplate
wdio ./config/wdio.ios.app.conf.ts
sh: wdio: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! [email protected] ios.app: wdio ./config/wdio.ios.app.conf.ts
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] ios.app script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Environment (please complete the following information):
Hey Guys, I'm getting the following when trying to run the tests. I suspect it might have to do with the Node version and ES6 support but just guessing
Environment (please complete the following information):
Describe the bug
Getting the following for all the specs when running npm run android.app
[0-0] RUNNING in Android - /tests/specs/app.forms.spec.js
[0-0] Error: Cannot use import statement outside a module
[0-0] FAILED in Android - /tests/specs/app.forms.spec.js
Expected behavior
Tests are executed
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.