-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
fix(tests): Move leftover acceptance tests for users from drone to Cypress #41021
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, we talked abut this before with various other devs. I advocated for the usage of
data-cy-xxxx
and seemed that other devs agreed too after a some discussion. This allow to scope the elements.I know what the best-practices says, but I think they do not have our overall ecosystem, so things differs a bit :)
The data attribute value should be used when it have a real changing value. Like
data-cy-userslist-user="admin"
. Otherwise it makes really weird to target a specific element.I also prefer to have more unique data attributes. The fact that you can grep all
[data-cy="files-list-row"]
makes no sense imho.But
[data-cy-files-list-row]
and[data-cy-files-list-row-fileid="12345"]
does :)Any thoughts or counter arguments?
cc @artonge @max-nextcloud @Pytal as I recall you were in that discussion before 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me it makes no difference if I use
data-testid
ordata-cy
both a pretty common and standard, so I am fine with both.Well for me not that much 😅
data-cy="files-list-row"
for me this is like theid
(without its singleton limitation), so it says "Select all elements that are file list rows". Whiledata-cy-files-list-row-fileid="12345"
says "get the file list row that for file ID 12345".So my problem with
data-cy-files-list-row
vsdata-cy="files-list-row"
is that there is no consistent naming for identifying elements, you always need to use a specific attribute rather that a specific attribute ID.This feels wrong in a HTML context.
But this is not about feels, so I have no problem to stick with one notation for all of our code and if it was decided to go with
data-cy-some-identifier
as boolean attribute then I am fine with it. As there is no technical downside 😃Need some time to adjust this PR then for
data-cy
and we should probably add this to our development guides :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TL;DR: Will take some time this week to adjust the test selectors 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want all the lines, then you can also do
[data-cy-files-list-row-fileid]
, without the id.That's the benefit of scoped selectors. And with
[data-cy="files-list-row"]
, you cannot select by Ids with that syntax.Or with something like
[data-cy="files-list-row-123456"]
, but I find it incredibly messy 🤷