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

Implement extension to jslib expect library for xk6-browser #104

Open
robingustafsson opened this issue Nov 12, 2021 · 0 comments
Open

Implement extension to jslib expect library for xk6-browser #104

robingustafsson opened this issue Nov 12, 2021 · 0 comments
Labels
feature A new feature playwright Issue relating to Playwright compatibility

Comments

@robingustafsson
Copy link
Member

We want to start promoting the k6 expect library more for at least functional, contract validation and browser end-to-end testing, but probably also for load testing. Different types of tests need to verify, or expect, different things. In browser end-to-end testing you want to expect things like expect(element).toBeVisible() or expect(page.screenshot()).toMatchSnapshot('referenceScreenshot.js') (using https://github.com/mapbox/pixelmatch).

Here's a non-exhaustive list of expect extensions that we'd want:

  • expect(element).toBeChecked()
  • expect(element).toBeDisabled()
  • expect(element).toBeEditable()
  • expect(element).toBeEmpty()
  • expect(element).toBeEnabled()
  • expect(element).toBeFocused()
  • expect(element).toBeHidden()
  • expect(element).toBeUnchecked()
  • expect(element).toBeVisible()
  • expect(element).toContainText(text)
  • expect(element).toHaveAttribute(attribute)
  • expect(element).toHaveClass(class)
  • expect(element).toHaveCount(count)
  • expect(element).toHaveCSS(css)
  • expect(element).toHaveId(id)
  • expect(element).toHaveJSProperty(property)
  • expect(element|frame|page).toHaveText(text)
  • expect(frame|page).toHaveTitle(title)
  • expect(frame|page).toHaveURL(url)
  • expect(element).toHaveValue(value)
  • expect(element.screenshot()|page.screenshot()|ArrayBuffer).toMatchSnapshot(filename)

Relevant links:

@robingustafsson robingustafsson added feature A new feature playwright Issue relating to Playwright compatibility next Might be eligible for the next planning (not guaranteed!) labels Nov 12, 2021
@inancgumus inancgumus removed the next Might be eligible for the next planning (not guaranteed!) label Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature playwright Issue relating to Playwright compatibility
Projects
None yet
Development

No branches or pull requests

2 participants