Closed siddharthmlk closed 2 years ago
Hi Siddarth,
it seems like something is a little bit off with your spec
file. In the console log you can actually see, that it skips your tests:
Spec Files: 0 passed, 1 skipped, 1 total (100% completed) in 00:00:01
Could you maybe share your spec file as well?
A few more things I noticed with your config:
wdio-ui5-service
version is not up to date. As we made - and still will - a lot of changes in the last couple of weeks we recommend to update the module regularly as long as we have not reached our 1.0.0 release.google.com
and check for the title (or is this just a placeholder?). Unfortunately you can't use wdi5 for this, as it is a non UI5 application. WDI5 needs a UI5 application to be used in a meaningful way. If you start your tests with a non ui5 application and only later navigate to an UI5 Application you should set skipInjectUI5OnStart: true
and later on inject WDI5 as described hereRegards Simon
Hell Simon,
Thanks for looking. I made few changes, upgraded dependencies to the latest and set base URL to https://sapui5.hana.ondemand.com/
upgraded depdencies
"devDependencies": {
"@wdio/cli": "^7.19.3",
"@wdio/jasmine-framework": "^7.19.3",
"@wdio/local-runner": "^7.19.3",
"@wdio/spec-reporter": "^7.19.1",
"browserify": "16.5.2",
"chromedriver": "^100.0.0",
"colors": "1.4.0",
"express": "4.17.1",
"grunt": "1.0.3",
"grunt-cli": "1.3.2",
"grunt-karma": "3.0.2",
"grunt-string-replace": "1.3.1",
"jasmine-core": "3.6.0",
"karma": "5.1.1",
"karma-browserify": "6.1.0",
"karma-chrome-launcher": "3.1.0",
"karma-cli": "2.0.0",
"karma-coverage": "2.0.1",
"karma-html-reporter": "0.2.7",
"karma-jasmine": "2.0.1",
"karma-junit-reporter": "1.2.0",
"karma-openui5": "0.2.3",
"karma-qunit": "4.1.1",
"karma-ui5": "1.2.0",
"karma-webdriver-launcher": "1.0.8",
"nodemon": "2.0.6",
"qunit": "2.10.0",
"rimraf": "2.7.1",
"start-server-and-test": "1.11.3",
"watchify": "3.11.1",
"wdio-chromedriver-service": "^7.3.2",
"wdio-ui5-service": "^0.9.0-rc3",
"webdriverio": "^7.19.3"
basic.test.js
const Main = require("../pageObjects/Main")
describe("ui5 basic", () => {
before(async () => {
await Main.open()
})
it("should have the right title", async () => {
const title = await browser.getTitle()
expect(title).toEqual("Sample UI5 Application")
})
});
Main.js
const { wdi5 } = require("wdio-ui5-service")
module.exports = class Main {
async open(path) {
wdi5.goTo(path)
}
}
I am still getting the same response. Not sure what is missing now.
$ npx wdio
Execution of 1 workers started at 2022-04-08T09:47:18.847Z
2022-04-08T09:47:18.850Z DEBUG @wdio/utils:initialiseServices: initialise service "chromedriver" as NPM package
2022-04-08T09:47:18.932Z DEBUG @wdio/utils:initialiseServices: initialise service "ui5" as NPM package
2022-04-08T09:47:19.006Z INFO @wdio/cli:launcher: Run onPrepare hook
2022-04-08T09:47:19.010Z INFO chromedriver: Start Chromedriver (C:\Users\abc-workspace\xyz\ui\node_modules\chromedriver\lib\chromedriver\chromedriver.exe) with args --port=9515 --url-base=/
2022-04-08T09:47:19.757Z INFO chromedriver: Starting ChromeDriver 100.0.4896.60 (6a5d10861ce8de5fce22564658033b43cb7de047-refs/branch-heads/4896@{#875}) on port 9515
2022-04-08T09:47:19.758Z INFO chromedriver: Only local connections are allowed.
2022-04-08T09:47:19.759Z INFO chromedriver: Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
2022-04-08T09:47:19.772Z INFO chromedriver: ChromeDriver was started successfully.
2022-04-08T09:47:19.818Z DEBUG @wdio/cli:utils: Finished to run "onPrepare" hook in 811ms
2022-04-08T09:47:19.819Z INFO @wdio/cli:launcher: Run onWorkerStart hook
2022-04-08T09:47:19.820Z DEBUG @wdio/cli:utils: Finished to run "onWorkerStart" hook in 0ms
2022-04-08T09:47:19.821Z INFO @wdio/local-runner: Start worker 0-0 with arg:
[0-0] 2022-04-08T09:47:20.637Z INFO @wdio/local-runner: Run worker command: run
[0-0] 2022-04-08T09:47:20.645Z DEBUG @wdio/config:ConfigParser: No compiler found, continue without compiling files
[0-0] 2022-04-08T09:47:20.651Z DEBUG @wdio/local-runner:utils: init remote session
[0-0] 2022-04-08T09:47:20.656Z DEBUG @wdio/utils:initialiseServices: initialise service "chromedriver" as NPM package
[0-0] 2022-04-08T09:47:20.765Z DEBUG @wdio/utils:initialiseServices: initialise service "ui5" as NPM package
2022-04-08T09:47:21.170Z DEBUG @wdio/local-runner: Runner 0-0 finished with exit code 0
2022-04-08T09:47:21.170Z INFO @wdio/cli: [0-0] SKIPPED in chrome - C:\Users\abc-workspace\xyz\ui\webapp\test\e2e\specs\basic.test.js
2022-04-08T09:47:21.171Z INFO @wdio/cli:launcher: Run onWorkerEnd hook
2022-04-08T09:47:21.171Z DEBUG @wdio/cli:utils: Finished to run "onWorkerEnd" hook in 0ms
2022-04-08T09:47:21.172Z INFO @wdio/cli:launcher: Run onComplete hook
2022-04-08T09:47:21.172Z DEBUG @wdio/cli:utils: Finished to run "onComplete" hook in 0ms
Spec Files: 0 passed, 1 skipped, 1 total (100% completed) in 00:00:02
2022-04-08T09:47:21.174Z INFO @wdio/local-runner: Shutting down spawned worker
2022-04-08T09:47:21.429Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully
2022-04-08T09:47:21.429Z INFO @wdio/local-runner: shutting down
Hi Siddarth,
I had a look at your spec file and I think we have 2 Problems here:
The main reason why your test is not executed, is the before
function. In your configuration file you decided to use jasmine
and in jasmine there is no before
function . This function only exists in mocha
, which we use in all our tests. The equivalent function in Jasmine would be beforeAll.
The second problem, after you use the correct before function, will be in your Main.js
. You have to instantiate the pageObject otherwise this will not work. Your file could look something like this:
const { wdi5 } = require("wdio-ui5-service");
class Main {
async open(path) {
wdi5.goTo(path);
}
}
module.exports = new Main();
I hope this will help you to solve the problem.
Best regards, Simon
hey 👋 - silence for 30 days 🤐 ... anybody? 😀
@siddharthmlk still a thing? Or solved with the last answer from @Siolto ?
hey 👋 - silence for 30 days 🤐 ... anybody? 😀
closed 📴 because silencio 🤫 since an additional 14 days after staleness 📠
Hello, I just started using wdi5 and trying to setup and run a simple spec file to open a browser and validate title as mentioned in your example, but getting below response without any error or warnings. Tried lot of permutations and combinations but nothing worked.
My wdio.conf.js is
package.json