interactors icon indicating copy to clipboard operation
interactors copied to clipboard

API for reading the URL via the Page interactor

Open taras opened this issue 3 years ago • 4 comments

I'm working in a Cypress test suite and I wanted to use the Page interaction to check the URL. I tried the Page interaction but it doesn't seem to have any way to access the URL.

Cypress provides an API for interaction with the URL via cy.url. Do we want to have our own mechanism for doing this or should we rely on Cypress' API?

taras avatar Jan 28 '22 18:01 taras

It definitely has a filter for the url https://github.com/thefrontside/interactors/blob/main/packages/html/src/page.ts#L7

Is that not working? Or do we not add the filters to the object so you can't say:

await Page.url();

In the way that you can await a normal filter value:

await Button("Submit").enabled();
GitHub
Composable page objects for components. Contribute to thefrontside/interactors development by creating an account on GitHub.

cowboyd avatar Jan 28 '22 19:01 cowboyd

@cowboyd I think I didn't know I can get that. I'll try it.

taras avatar Jan 28 '22 20:01 taras

@taras That sounds like a bug in our documentation

cowboyd avatar Jan 29 '22 16:01 cowboyd

@taras How do you think we could improve the docs to make this not an issue.

cowboyd avatar Feb 03 '22 05:02 cowboyd