You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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 likeexpect(element).toBeVisible()
orexpect(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:
The text was updated successfully, but these errors were encountered: