Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

waitForTimeout not working when selenoid plugin is used #2589

Closed
suniljaiswal01 opened this issue Sep 19, 2020 · 1 comment · Fixed by #3478
Closed

waitForTimeout not working when selenoid plugin is used #2589

suniljaiswal01 opened this issue Sep 19, 2020 · 1 comment · Fixed by #3478

Comments

@suniljaiswal01
Copy link
Contributor

What are you trying to achieve?

I am trying to run my testcase using the default waitForTimeout Value. But when i use selenoid plugin as well, the waitForTimeout value is not getting used and my test are getting failed within milliseconds.

Below are my observation because of which the issue could have been occured:

https://github.com/codeceptjs/CodeceptJS/blob/master/lib/plugin/selenoid.js#L340
https://github.com/codeceptjs/CodeceptJS/blob/master/lib/plugin/selenoid.js#L352

Whenever the _setConfig method is called, waitForTimeout value is getting divided by 1000. because of which whatever is the initial value passed in the codecept.conf.js file, gets decreased before every test execution.

What do you get instead?

Not able to use selenoid plugin along with waitForTimeout.

Provide console output if related. Use --verbose mode for more details.

-- FAILURES:

  1) Selenoid
       Selenoid Plugin Test:
     element (//a[@class='Header-link']) still not visible after 0.00001 sec
  Scenario Steps:

  - I.waitForVisible("//a[@class='Header-link']") at Test.<anonymous> (selenoidIssue_test.js:5:7)
  - I.amOnPage("https://github.com") at Test.<anonymous> (selenoidIssue_test.js:4:7)

Provide test source code if related

Feature('Selenoid');

Scenario('Selenoid Plugin Test', (I) => {
    I.amOnPage('https://github.com');
    I.waitForVisible("//a[@class='Header-link']");
});

Details

  • CodeceptJS version:2.6.10
  • NodeJS Version: 12.18.4
  • Operating System: Windows 10
  • puppeteer || webdriverio || protractor || testcafe version (if related) : webdriverio
  • Configuration file:
const { setHeadlessWhen } = require('@codeceptjs/configure');

// turn on headless mode when running with HEADLESS=true environment variable
// export HEADLESS=true && npx codeceptjs run
setHeadlessWhen(process.env.HEADLESS);

exports.config = {
  tests: './*_test.js',
  output: './output',
  
  helpers: {
    WebDriver: {
      host: "192.168.99.100",
      port: 4444,
      waitForTimeout: 10000,
      url: 'http://localhost',
      browser: 'chrome'
    }
  },
  include: {
    I: './steps_file.js'
  },
  bootstrap: null,
  mocha: {},
  name: 'CodeceptTest',
  plugins: {
    retryFailedStep: {
      enabled: true
    },
    screenshotOnFail: {
      enabled: true
    },
    selenoid:{
      enabled: true,
      enableVideo: true,
      enableLog:true
    },
    wdio: {
      enabled: false,
      services: ['selenium-standalone']
    }
  }
}
@pmajewski24
Copy link
Contributor

pmajewski24 commented Oct 27, 2022

Same happens, if a Config is set/reset in a Scenario.

CodeceptJs: 3.3.6
Helper: WebDriver, Protractor, Appium

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants