Comments (14)
Does someone found the solution?
Nothing helps: type:module, renaming to cjs or mjs, adding babel and adding to wdio,conf.js require: [babel/register]. Always the same problem with "import" statement, but when I hover on "import" I can see a pop-up hint, so it means Node can read some imported file/function, but not able to run. In the whole internet so far I don't find any answer. Please, if you somehow resolve this issue, reply to this!
Thanks in advance.
from appium-boilerplate.
Having a babel.config.js
setup helped me get over this. See WebdriverIO for details.
from appium-boilerplate.
Hi @ggiunta
Yes, this is a ES6 support thing, when are you having this? With the current project, or when you do some modifications? The project should work out if the box because it uses Babel to solve this.
from appium-boilerplate.
I just cloned the repo, followed instructions and run the tests with the Android cmd. Did not change a thing
from appium-boilerplate.
Sorry for my late response, the diff might be in the supported NodeJS env, I need to dig into it, haven't got the time today. It works with Node 10 and 12 on my machine so for as far I can see it not an issue with the boilerplate itself but more an environmental issue. Can you also test it with an older version of Node?
I'll get back to you with my results when I have some more time
from appium-boilerplate.
If the import isn't recognized it will complain about the syntax, in this specific case however it looks like an import is used on a file for which it cannot find any modules to import @wswebcreation
from appium-boilerplate.
I've been running this with Node v13.8.0
and with v10.18.1
and I get this result
➜ appium-boilerplate git:(master) npm run android.app -- --spec=/tests/specs/app.forms.spec.js
> [email protected] android.app /Users/wimselles/Sauce/Git/appium-boilerplate
> wdio ./config/wdio.android.app.conf.js "--spec=/tests/specs/app.forms.spec.js"
Execution of 1 spec files started at 2020-02-09T07:21:42.737Z
[0-0] RUNNING in Android - /tests/specs/app.forms.spec.js
[0-0] PASSED in Android - /tests/specs/app.forms.spec.js
"spec" Reporter:
------------------------------------------------------------------
[emulator-5554 LINUX 8.1.0 #0-0] Spec: /Users/wimselles/Sauce/Git/appium-boilerplate/tests/specs/app.forms.spec.js
[emulator-5554 LINUX 8.1.0 #0-0] Running: emulator-5554 on LINUX 8.1.0 executing /Users/wimselles/Sauce/Git/appium-boilerplate/apps/Android-NativeDemoApp-0.2.1.apk
[emulator-5554 LINUX 8.1.0 #0-0] Session ID: 266d8280-cc89-41af-aff4-85f8bd0fc41e
[emulator-5554 LINUX 8.1.0 #0-0]
[emulator-5554 LINUX 8.1.0 #0-0] WebdriverIO and Appium, interacting with form elements,
[emulator-5554 LINUX 8.1.0 #0-0] ✓ should be able type in the input and validate the text
[emulator-5554 LINUX 8.1.0 #0-0] ✓ should be able turn on and off the switch
[emulator-5554 LINUX 8.1.0 #0-0] ✓ should be able select a value from the select element
[emulator-5554 LINUX 8.1.0 #0-0] ✓ should be able to open the alert and close it with all 3 buttons
[emulator-5554 LINUX 8.1.0 #0-0] ✓ should be able to determine that the inactive button is inactive
[emulator-5554 LINUX 8.1.0 #0-0]
[emulator-5554 LINUX 8.1.0 #0-0] 5 passing (17.4s)
Spec Files: 1 passed, 1 total (100% completed) in 00:00:24
To be honest, I don't know where this error is coming from, what happens if you run this with logLevel=debug
, can you post the logs here?
Secondly you mention that you didn't change the cloned project but by default it takes Android 8.1, are you sure you didn't make any changes?
from appium-boilerplate.
Closing due to inactivity
from appium-boilerplate.
I got the same error running on Node v13.12.0
cd ./examples/pageobject
npm test
throw error
Execution of 1 spec files started at 2020-04-13T23:54:42.128Z
[0-0] RUNNING in chrome - /specs/dynamic.spec.js
[0-0] Error: Cannot use import statement outside a module
[0-0] FAILED in chrome - /specs/dynamic.spec.js
Spec Files: 0 passed, 1 failed, 1 total (100% completed) in 00:00:03
npm ERR! Test failed. See above for more details.
from appium-boilerplate.
Can you create a new issue and provide an example, as mentioned, I can't reproduce it, this might even be a coding issue in your own framework
from appium-boilerplate.
Thanks. I added as new issue #72
from appium-boilerplate.
I am getting error while trying to start Appium in java code.
AppiumDriverLocalService service;
AppiumServiceBuilder builder = new AppiumServiceBuilder();
builder.withIPAddress("127.0.0.1");
builder.usingPort(Integer.parseInt("4723"));
builder.withAppiumJS(new File("C:\Users\Ritesh Mittal\AppData\Roaming\npm\node_modules\appium\lib\appium.js"));
service = AppiumDriverLocalService.buildService(builder);
service.start();
System.out.println("Appium Service Started ");
Error
C:\Users\Ritesh Mittal\AppData\Roaming\npm\node_modules\appium\lib\appium.js:1
import _ from 'lodash';
^^^^^^
SyntaxError: Cannot use import statement outside a module
from appium-boilerplate.
Having the same issue...
from appium-boilerplate.
having the same issue
from appium-boilerplate.
Related Issues (20)
- I can't run local IOS test HOT 1
- Browserstack app capabilities no longer work with WDIO v7.20.0 HOT 1
- fingerPrint(fingerprintid) is not working HOT 6
- driverScript() throwing element not found error HOT 2
- add github actions example HOT 9
- ios.app webview flacky tests fail on ios platform 15.5 and iPhone 12 HOT 4
- Does this boilerplate use jasmine or mocha? HOT 1
- ios app unit tests fail mainly due to webview HOT 1
- android app unit tests fail mainly due to webview HOT 1
- Update dependencies to use v8 HOT 4
- getAlertText() not work with faceID not matching HOT 2
- Run tests parallel on different devices HOT 3
- How we can upgrade this project to v8? HOT 1
- issue
- No Spec Found To Run HOT 3
- Reset cache between tests (particularly on iOS) HOT 3
- not possibility to run in local Android HOT 3
- Problem in Webview screen about chromedriver HOT 1
- Using for statement in spec file HOT 1
- Activate mobile testing pipelines HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from appium-boilerplate.