-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
allow for aliasing of things beside DOM elements #5
Comments
Would |
Yes, |
Yah that's what I talked to Jennifer about when she brought up this issue. Should I extend There are still advantages to The above example would look like this using describe "asset search", ->
beforeEach ->
cy
.route(/assets/, {}).as("getAssets")
.get("form").submit()
.wait("@getAssets").its("url").assign("requestUrl")
it "does not search areaId", ->
expect(@requestUrl).not.to.match(/areaId/)
it "does not search locationId", ->
expect(@requestUrl).not.to.match(/locationId/) With describe "asset search", ->
beforeEach ->
cy
.route(/assets/, {}).as("getAssets")
.get("form").submit()
.wait("@getAssets").its("url").assign("requestUrl")
it "does not search areaId", ->
cy.wrap(@requestUrl).should("not.match", /areaId/)
it "does not search locationId", ->
cy.wrap(@requestUrl).should("not.match", /locationId/) Both are functionally equivalent. I would say that all users will at some point use aliasing, since it has a much broader use case. I wouldn't say however that all users will use assign. If that assumption is true, instead of introducing 2 commands (at least) to handle assigning, it might make more sense to expand aliasing to accommodate all values. I don't know yet I'll keep coming up with examples and make a decision after I see more situations. |
This has been implemented in
In other words, |
I'd like to be able to alias things other than DOM elements, for example a url string of a request. example:
This currently just says
Syntax error, unrecognized expression: @requestUrl
The text was updated successfully, but these errors were encountered: