mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
Fix probably randomly failing cypress test
@mattwr18 @ulfgebhardt @tirokk @appinteractive @ogerly I think I just fixed a randomly failing test (so-called "flaky" test). After an update of `neo4j-graphql-js` I wondered why the `TagsAndCategories.feature` test failed consistently. It turns out the table that you can see in the test is ordered by the "Users" column: | | Name | Users | Posts | | 1 | Democracy | 2 | 3 | | 2 | Ecology | 1 | 1 | | 3 | Nature | 1 | 2 | So there is a tie between row 2 and row 3. It seems that on version 2.4.0 the backend would return those rows in arbitrary order and now it returns them in a deterministic order, thus failing the test every time. Therefore I changed the test setup and I believe this should also make the build more robust now.
This commit is contained in:
parent
45c64db90f
commit
a819d6353a
@ -32,6 +32,6 @@ Feature: Tags and Categories
|
||||
And I click on the menu item "Tags"
|
||||
Then I can see the following table:
|
||||
| | Name | Users | Posts |
|
||||
| 1 | Democracy | 2 | 3 |
|
||||
| 2 | Ecology | 1 | 1 |
|
||||
| 3 | Nature | 1 | 2 |
|
||||
| 1 | Democracy | 3 | 4 |
|
||||
| 2 | Nature | 2 | 3 |
|
||||
| 3 | Ecology | 1 | 1 |
|
||||
|
||||
@ -49,14 +49,23 @@ Given('we have a selection of tags and categories as well as posts', () => {
|
||||
email: 'author@example.org',
|
||||
password: '1234'
|
||||
}
|
||||
const yetAnotherAuthor = {
|
||||
id: 'yetAnotherAuthor',
|
||||
email: 'yet-another-author@example.org',
|
||||
password: '1234'
|
||||
}
|
||||
cy.factory()
|
||||
.create('User', someAuthor)
|
||||
.authenticateAs(someAuthor)
|
||||
.create('Post', { id: 'p0' })
|
||||
.create('Post', { id: 'p1' })
|
||||
cy.factory()
|
||||
.authenticateAs(loginCredentials)
|
||||
.create('User', yetAnotherAuthor)
|
||||
.authenticateAs(yetAnotherAuthor)
|
||||
.create('Post', { id: 'p2' })
|
||||
cy.factory()
|
||||
.authenticateAs(loginCredentials)
|
||||
.create('Post', { id: 'p3' })
|
||||
.relate('Post', 'Categories', { from: 'p0', to: 'cat1' })
|
||||
.relate('Post', 'Categories', { from: 'p1', to: 'cat2' })
|
||||
.relate('Post', 'Categories', { from: 'p2', to: 'cat1' })
|
||||
@ -65,7 +74,9 @@ Given('we have a selection of tags and categories as well as posts', () => {
|
||||
.relate('Post', 'Tags', { from: 'p0', to: 't3' })
|
||||
.relate('Post', 'Tags', { from: 'p1', to: 't2' })
|
||||
.relate('Post', 'Tags', { from: 'p1', to: 't3' })
|
||||
.relate('Post', 'Tags', { from: 'p2', to: 't2' })
|
||||
.relate('Post', 'Tags', { from: 'p2', to: 't3' })
|
||||
.relate('Post', 'Tags', { from: 'p3', to: 't3' })
|
||||
})
|
||||
|
||||
Given('we have the following user accounts:', table => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user