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

The waitFor method on locator only seems to work with the visible state. #472

Closed
ankur22 opened this issue Jul 27, 2022 · 0 comments · Fixed by #852
Closed

The waitFor method on locator only seems to work with the visible state. #472

ankur22 opened this issue Jul 27, 2022 · 0 comments · Fixed by #852
Assignees
Labels
bug Something isn't working
Milestone

Comments

@ankur22
Copy link
Collaborator

ankur22 commented Jul 27, 2022

Tested against: dbede12

The waitFor method on locator only seems to work with the visible state.

In the below code it works against localhost:8080, which is a test server that can be found here with instructions on how to run it locally: https://github.com/ankur22/testserver.

import { sleep } from 'k6';
import launcher from 'k6/x/browser';

export default function () {
  const browser = launcher.launch('chromium', {
    headless: false,
  });
  const context = browser.newContext();
  const page = context.newPage();
  const res = page.goto('http://localhost:8080/other');
  const l = page.locator('#input-text-hidden');
  l.waitFor({
    state: 'hidden',
  });
  const l2 = page.locator('#input-text-test');
  l2.fill('wait complete');

  sleep(5);
  browser.close();
}

In the test above against the test page, the expected output is that wait complete is filled in one of the input text boxes, but this doesn't happen and instead times out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants