Skip to content

waitForText default time #19

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

Open
Arytas opened this issue Aug 29, 2016 · 4 comments
Open

waitForText default time #19

Arytas opened this issue Aug 29, 2016 · 4 comments

Comments

@Arytas
Copy link

Arytas commented Aug 29, 2016

is there a defautl time set in waitForText() function?

if i dont set a max time i get this error
Expression wasn't true in 10000 ms. - expected "expression true" but got: expression false

if i set a max time to 10000
the element was found after 49ms

@maxgalbu
Copy link
Owner

maxgalbu commented Aug 30, 2016

Yes there is, what you see in the output:

Expression wasn't true in 10000 ms. - expected "expression true" but got: expression false

is the variabile (timeoutInMilliseconds) that is used as timeout:

this.check(elementSelector, checker, (result, loadedTimeInMilliseconds) => {
    if (result) {
        var message = `waitForText: ${elementSelector}. Expression was true after ${loadedTimeInMilliseconds - this.startTimeInMilliseconds} ms.`;
    } else {
        var message = `waitForText: ${elementSelector}. Expression wasn't true in ${timeoutInMilliseconds} ms.`;
    }

    this.client.assertion(result, 'expression false', 'expression true', message, true);
    return this.emit('complete');
}, timeoutInMilliseconds);

Can you share your code?

@Arytas
Copy link
Author

Arytas commented Aug 30, 2016

this was the code before i add my default waitForConditionTiemout

upgrade.waitForText('@deploy-status', (text) => {
    return text === 'done';
 });

there i get the error,
and if i use

upgrade.waitForText('@deploy-status', (text) => {
      return text === 'done';
}client.globals.waitForConditionTimeout);

it works fine for me

@maxgalbu
Copy link
Owner

Does it work if you're not using page objects?

@Arytas
Copy link
Author

Arytas commented Aug 30, 2016

yes without page object it is working

i called now this

  upgradeall.waitForText('div.dialog__content div:nth-child(1).grid__row div:last-child span', (text) => {
      return text === 'done';
    });
    upgradeall.waitForText('@download-status', (text) => {
      return text === 'done';
    });

it is the same selector and the first (with out page object call) is working and the second not

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

No branches or pull requests

2 participants