Skip to content
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 intermittendly failing file browser test #405

Merged
merged 2 commits into from
Aug 2, 2020

Conversation

romanofski
Copy link
Member

The change 47c72c2 tried to address the
intermittendly failing test, but I think made the mistake of
"hardcoding" the file we assume to be removing from the attachment list.

The problem however is, that the list of files we're adding as
attachment varies with the environment. While the screenshot.png is
probably the attachment in most cases, it isn't the attachment
in all cases. The assertion that the next screen does not show a
file which we never added is always true.

Instead, firstly, this patch asserts that the last filename is actually
listed as an attachment. Secondly, we assert that when the attachment is
removed the last file from before is gone. Furthermore we also check
whether the item count has changed.

Fixes: #327

The change 47c72c2 tried to address the
intermittendly failing test, but I think made the mistake of
"hardcoding" the file we assume to be removing from the attachment list.

The problem however is, that the list of files we're adding as
attachment varies with the environment. While the `screenshot.png` is
probably the attachment in most cases, it isn't the attachment
in **all** cases. The assertion that the next screen does not show a
file which we never added is always true.

Instead, firstly, this patch asserts that the last filename is actually
listed as an attachment. Secondly, we assert that when the attachment is
removed the last file from before is gone. Furthermore we also check
whether the item count has changed.

Fixes: #327
This uses what we've learned in the previous change and applies it to
the remaining tests using a "Not" condition without asserting the
presence of the element in the first place. This only applies to
asserting that something was present in the previous screen and is now
gone in the subsequent screen.
@frasertweedale
Copy link
Member

Wow, will this really fix it forever? merge when green, I don't have the headspace to work this all out rn but I trust you mate!

@romanofski
Copy link
Member Author

Cheers! Yeah it annoyed me quite a bit for my last pull request. I hope I got now all bases covered.

@romanofski romanofski merged commit a2b5d0c into master Aug 2, 2020
@romanofski romanofski deleted the fix/327-filebrowser-test branch August 2, 2020 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Intermittent test failure in file browser test
2 participants