Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jul 30 20:04

    erwinheitzman on main

    fix hyperlink on announcementba… (compare)

  • Jul 30 20:04
    erwinheitzman closed #7212
  • Jul 30 19:40
    spnraju synchronize #7212
  • Jul 30 19:28
    spnraju opened #7212
  • Jul 30 16:45
    erwinheitzman commented #7211
  • Jul 30 16:44
    erwinheitzman commented #7211
  • Jul 30 16:31
    erwinheitzman commented #7210
  • Jul 30 16:24
    lacell75 edited #7211
  • Jul 30 16:21
    lacell75 edited #7211
  • Jul 30 16:19
    lacell75 edited #7211
  • Jul 30 16:19
    lacell75 edited #7211
  • Jul 30 16:18
    lacell75 opened #7211
  • Jul 30 15:06
    lacell75 commented #7210
  • Jul 30 15:00
    lacell75 edited #7210
  • Jul 30 14:59
    lacell75 edited #7210
  • Jul 30 14:58
    lacell75 opened #7210
  • Jul 30 14:00
    erwinheitzman commented #7197
  • Jul 30 12:25
    staizen-alexm commented #7042
  • Jul 30 12:21
    iamkenos edited #7209
  • Jul 30 12:15
    iamkenos opened #7209
Marijana Rukavina
@mareru

Hello, I am using webdriverIO v7 and cucumber to test my application. When running tests in headless mode or non headless mode results in error: java.net.ConnectException: Connection refused: connect Some scenarios pass but in some fail with that error.
This is stack trace:

unknown error: java.net.ConnectException: Connection refused: connect
    at Object.getErrorFromResponseBody (C:\my-project\node_modules\webdriver\build\utils.js:189:12)
    at WebDriverRequest._request (C:\my-project\node_modules\webdriver\build\request.js:168:31)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at Browser.runCommandWithHooks (C:\my-project\node_modules\@wdio\sync\build\wrapCommand.js:105:25)
    at Browser.runCommandWithHooks (C:\my-project\node_modules\@wdio\sync\build\wrapCommand.js:100:24)
    at Browser.url (C:\my-project\node_modules\@wdio\sync\build\wrapCommand.js:67:44)
    at MyPage.openImportPage (C:\my-project\src\pages\/myPage.js:32:17)
    at forEach (C:\my-project\src\helpers\/helpers.js:60:21)
    at Array.forEach (<anonymous>)
    at Helpers.deleteWishLists (C:\my-project\src\helpers\/helpers.js:55:51)
    at World.<anonymous> (C:\my-project\src\step_definitions\/config_steps.js:28:13)
    at World.executeSync (C:\my-project\node_modules\@wdio\sync\build\index.js:38:22)
    at World.executeSync (C:\my-project\node_modules\@wdio\sync\build\index.js:52:38)
    at C:\my-project\node_modules\@wdio\sync\build\index.js:69:68

Any ideas what the issue might be? Thanks!

AlexeyKa
@AlexeyCL
Hi all, I have a question:
We have a package, that I want to add code coverage. But we don't have any application for the package, we wrote many tests, used WDIO (not unit tests)
https://github.com/cloudinary/wdio-allure-ts
I tried to use wdio-coverage-service, but received 0% coverage, also tried to use intanbul as is, but received again 0%.
Could anybody can help me?
Raziel Alron
@razielron

Hi there, I am trying to send an API via axios.
I am using wdio v7 and sync mode.
I have a class that wraps onto axios to send API calls.
I get undefined when doing this through my axios class wrapper,
but when executing an API call through axios explicitly from the test it works, here is an example of what does work:

it('API call', async () => {
    resp = await browser.call(() => axios(request));
    console.log(resp); //resp is not a promise since I used await
});

I have a question regarding this code, why without browser.call() this code doesn't work?
this is the example code that does NOT work:

it('API call', async () => {
    resp = await browser.call(() => axiosWrapperFunction(request)); //this function calls axios inside her
    console.log(resp);
});

so since this didn't really work, I thought maybe I need to add the browser.call() only on the API call itself, so I added it to the axios call inside the function wrapper and it didn't work.
can someone help with this and why do I need this browser.call() why can't I just use async/await?

Erwin Heitzman
@erwinheitzman
Because you are using sync mode to start with. You can use async functions and tell wdio to wait till they are resolved in your test (the endpoint of the chain of promises) by using the call command as described in the documentation @razielron
1 reply
@AlexeyCL I suggest using the Devtools protocol to generate code coverage, you can find more about code coverage in our documentation
Xatabch
@Xatabch
Hello everybody! Please tell me, I select the input $ ('. Input') element with audio, do addValue for it and then do the same actions, but 3 files are loaded, the feeling that the input is not cleared
Raziel Alron
@razielron
use setValue instead
Xatabch
@Xatabch
an error occurs element is not interactable
Raziel Alron
@razielron
can you share the code you are using to do that?
Xatabch
@Xatabch
let input = $('.input');
browser.uploadFile(somePathToFile)
input.addValue(somePathToFile)
4 replies
and then repeat
Akamel
@Amrkamel1

Hi there, which js function i can trigger to execute the test instead of using npx wdio conf.js through terminal

I was trying something like

const wdio = require("@wdio/cli");
await wdio.run(config);
but got the following
image.png
not sure if what i should pass inside .run()
cpeck-bi
@cpeck-bi
krarpitgupta
@krarpitgupta
Hi Guys need your help I am using Cucumber + WebdriverIO v7 surprisingly
Then('I wait for {string} to not displayed', (elementInfo) => {
is recognized but when we are specifying like this
Then('I wait for {string} to (be|not) (clickable|displayed|enabled|exist)', (elementInfo, falseCase, condition) => {
It's not recognized getting following error Step "I wait for "SpinnerImage" to not displayed" is not defined. You can ignore this error by setting cucumberOpts.ignoreUndefinedDefinitions as true
Can anyone please help, I am having difficult time to understand what I am missing here ?
cpeck-bi
@cpeck-bi
@karpitgupta well, I am assuming you have accounted for that use case -- IE you have some step that should be running for that combination of arguments?
krarpitgupta
@krarpitgupta
@cpeck-bi May I know what I am missing here ?
I don't have any other step, I am in phase of building the things
cpeck-bi
@cpeck-bi
what does the step definition code look like, if you can share?
krarpitgupta
@krarpitgupta
Here it's

Then('I wait for {string} to (be|not) (clickable|displayed|enabled|exist)', (elementInfo, falseCase, condition) => {

let selector = lib.getSelector(elementInfo);
console.log("elementInfo : " + elementInfo);
console.log("falseCase : " + falseCase);
console.log("condition : " + condition);
lib.waitFor(selector, waitTimeout, true, `Timeout Occur : Spinner is displayed even after ${waitTimeout} ms`);

});

@cpeck-bi FYI
Here is the step in my feature file :
Then I wait for "SpinnerImage" to not displayed
However It works if I specify step like this : Then('I wait for {string} to not displayed', (elementInfo) => {
cpeck-bi
@cpeck-bi
how long is the waitTimeout generallly?
krarpitgupta
@krarpitgupta
It's 20000 ms
even If I comment lib.waitFor statement still step is not recognizable
krarpitgupta
@krarpitgupta
@cpeck-bi Any idea what I am missing here ?
For me it looks so strange
cpeck-bi
@cpeck-bi
you're not actually using the condition parameter are you?
or the falseCase?
krarpitgupta
@krarpitgupta
I am using
@cpeck-bi
Akamel
@Amrkamel1

@Amrkamel1 you can find the syntax here https://webdriver.io/docs/clioptions/#run-the-test-runner-programmatically

thank you so much its working now

Johnson E
@jonn-set
Hi, can someone help me with this issue please? https://github.com/webdriverio/webdriverio/discussions/6688

Copying this problem here:

We are using browser.mock() to spy on non XHR calls and we have situation where we need to do a browser.sessionReload() which causes browser.mock() to stop working on any new window opened. Is this is expected? And is there a workaround to this? We cant use clearCookies() as we have multiple applications and the clearing cookies at the end only clears cookies of the last opened domain.

Raziel Alron
@razielron
does anyone knows which version of Jasmine does wdio uses?
tobeliketree
@tobeliketree

My team keeps running into performance metrics errors when trying test the loading of an image gallery that first requires authentication first. The actual error is

[0-0] LHError in "Testing the performance of a specific core library gallery with 50 assets. Should open and get the performance metrics from core library gallery with 50 assets" LHError: NO_TTI_NETWORK_IDLE_PERIOD at Function.findOverlappingQuietPeriods (/Users/tree/Git_Repositories/performance/node_modules/lighthouse/lighthouse-core/computed/metrics/interactive.js:136:11) at Function.computeObservedMetric (/Users/tree/Git_Repositories/performance/node_modules/lighthouse/lighthouse-core/computed/metrics/interactive.js:165:41) at Function.compute_ (/Users/tree/Git_Repositories/performance/node_modules/lighthouse/lighthouse-core/computed/metrics/metric.js:65:21) at Browser.next [as getMetrics] (/Users/tree/Git_Repositories/performance/node_modules/@wdio/utils/build/monad.js:95:33)

Does anyone have any help on this and what LHError or NO_TTI_NETWORK_IDLE_PERIOD means and how I adjust a rather simple metrics test? . My test couldn't be any simpler and the util metrics function is gathering all available metrics results the wdio performance audits offers

 before(function(){
        browser.enablePerformanceAudits(); 
        const userVariables = tv.config.coreUserCredentials.
            sauce[sanitizedCapabilities.getBrowserOSName()];
        CoreImagesLeftPane.open(library);
        LoginPage.submitCoreLogin(userVariables.username, 
            userVariables.password);   
        CoreImagesLeftPane.clickListedTab();
    });

    after(function() {
        browser.disablePerformanceAudits();
    });

    it('Should open and get the performance metrics from core library gallery with 50 assets', function () {
        CoreImagesLeftPane.openCollectionOrGallery(fiftyImageGallery); 
        util.getPerformanceData();
    });
Erwin Heitzman
@erwinheitzman
@razielron you can check the version in the package.json of the jasmine framework service
7 replies
@jonn-set someone already replied and asked the question with a good reason as this issue should probably be resolved in v7
Johnson E
@jonn-set
@erwinheitzman thanks, is the upgrade from 6 to 7 non breaking?
Scott Mac Donald
@Corinos
Hey folks, does anyone have a tool for testing WDIO selectors? I have chained selector that seems to work with each part on their own in the console, but since the console doesn't let me use chained selectors the same way, I can't test the whole thing, and when I run WDIO using that selector, i get an unexpected return.