Skip to content
This repository has been archived by the owner on Dec 18, 2019. It is now read-only.

browser.waitForVisible(...) returns timeout error on certain situation #31

Open
Taewa opened this issue Jun 14, 2019 · 0 comments
Open

Comments

@Taewa
Copy link

Taewa commented Jun 14, 2019

Hi all,
I am wondering how wdio v4 detects if certain element is visible when I test with browser.waitForVisible().

I have a reproducible code.
And there is explanation on readme.md.

Simply, if there is a component that has only a child element that has position:absolute, browser.waitForVisible() not working (timeout) even if it's actually visible on the browser.

I guess it's failing because <child-component> has 0 height.

This failure is expected behavior?

On readme.md, there is 'The solutions I have found so far' section.
Please let me know this is correct approach.

note 1: I am testing with shadowDom. I have installed wdio-webcomponents.
note 2: I am using wdio 4 because of CucumberJs.

** The key point is the below code. **

// step.js
Then('I should see form', () => {
    const path = 'e2e-app child-component';
    browser.waitForVisible(path, 10000);
});

// child-component.html
<style>
    form {
      /* 'fixed' will be also failing */
      position: absolute; 
    }
</style>
    
<form>
    <label for="someInput">Your name :</label>
    <input type="text" id="someInput">
</form>

Environment (please complete the following information):

  • **WebdriverIO: 4.13.2
  • Mode: : I actually don't know. I am running by ./node_modules/.bin/wdio wdio.e2e.conf.js. Is this runner mode?
  • Node.js version: 8.16.0
  • NPM version: 6.4.1
  • Browser name and version: Chrome 75.0
  • Platform name and version: OSX Mojave 10.14.5
  • Additional wdio packages used (if applicable):
  • selenium-standalone: 6.16.0
  • wdio-chromedriver-service: 0.1.5
  • wdio-cucumber-framework: 2.2.8
  • wdio-dot-reporter: 0.0.10
  • wdio-json-reporter: 0.4.0
  • wdio-junit-reporter: 0.0.2
  • wdio-multiple-cucumber-html-reporter: 0.3.3
  • wdio-selenium-standalone-service: 0.0.12
  • wdio-spec-reporter: 0.1.5
  • wdio-sync: 0.7.3
  • wdio-webcomponents: 1.1.0
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant