-
Notifications
You must be signed in to change notification settings - Fork 2.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
[stable10] UI tests for delete feature #28811
Conversation
And I am on the files page | ||
|
||
Scenario: Delete files & folders one by one and check its existence after page reload | ||
When I delete the folder "simple-folder" |
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.
There should be only one when per scenario. many "Given" one "When" and many "Then"
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.
This is true in theory. There should be some "Given" steps to set things up (they might all be in the Background: like here), then a set of "When" (with maybe a few steps) to carry out the actions, then a set of "Then" that check the result.
So we could easily make separate scenarios here.
The practical side for UI tests, is that the "test setup" phase - creating user, logging in, navigating to the desired page... - takes so long. So to speed it up, it is practical to make multiple when-then in a scenario.
Also, sometimes there are genuinely mixed sequences of when-then needed. e.g. even if only 1 file delete is tested here, we want to:
- when "delete the file"
- then "see if it is gone from the local page"
- when "reload the page"
- then "see if it really is gone"
because if the Javascript/AJAX is not working properly, (2) and/or (4) might fail.
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.
Here is a sample discussion of this issue, where there is a "workflow" to be acceptance tested:
https://stackoverflow.com/questions/12060011/is-it-acceptable-to-write-a-given-when-then-when-then-test-in-gherkin
and of course there are different opinions on how best to do it.
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.
I don't like this approach, it is like a test script. You could use given-and as preconditions, or even hiding those thens after the whens by checking it directly in the code.
There should be only one thing marked as when, rest are preconditions or postconditions.
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.
The step sequence could be re-ordered so the "when" all come first:
Scenario: Delete files & folders one by one and check its existence after page reload
When I delete the folder "simple-folder"
And I delete the file "lorem.txt"
And I delete the folder "strängé नेपाली folder"
And I delete the file "strängé filename (duplicate #2).txt"
Then the folder "simple-folder" should not be listed
And the file "lorem.txt" should not be listed
And the folder "strängé नेपाली folder" should not be listed
And the file "strängé filename (duplicate #2).txt" should not be listed
When the files page is reloaded
Then the folder "simple-folder" should not be listed
And the folder "strängé नेपाली folder" should not be listed
And the file "lorem.txt" should not be listed
And the file "strängé filename (duplicate #2).txt" should not be listed
the last "When the files page is reloaded" could be renamed to "And the files page is reloaded" - that just "hides" the fact that it is an action, and makes no real difference.
Maybe it could be cut down to:
Scenario: Delete files & folders one by one and check its existence after page reload
When I delete the folder "simple-folder"
And I delete the file "lorem.txt"
And I delete the folder "strängé नेपाली folder"
And I delete the file "strängé filename (duplicate #2).txt"
Then the deleted items should not be listed
and the code can remember which files have been deleted, and code for Then the deleted items should not be listed
can check for the files on the current page, then reload the page and check again.
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.
Anyway, this is a back-port of a commit in master. Whatever we change needs to be changed in master and also back-ported.
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.
Maybe it could be a table
When I delete the elements
| simple-folder |
| lorem.txt |
(...)
Then the deleted items should not be listed
If the difference between folder and element is required, using another column detailing folder/file.
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.
@SergioBertolinSG Let me merge this as its only a backport and I will do a new PR against master
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.
👍
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Backport #28809