mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Hopefully fix flaky tags and categories test
This commit is contained in:
parent
5f684479f0
commit
6a356dd8b1
@ -21,8 +21,8 @@ Feature: Tags and Categories
|
|||||||
Scenario: See an overview of categories
|
Scenario: See an overview of categories
|
||||||
When I navigate to the administration dashboard
|
When I navigate to the administration dashboard
|
||||||
And I click on the menu item "Categories"
|
And I click on the menu item "Categories"
|
||||||
Then I can see a list of categories ordered by post count:
|
Then I can see the following table:
|
||||||
| Icon | Name | Posts |
|
| | Name | Posts |
|
||||||
| | Just For Fun | 2 |
|
| | Just For Fun | 2 |
|
||||||
| | Happyness & Values | 1 |
|
| | Happyness & Values | 1 |
|
||||||
| | Health & Wellbeing | 0 |
|
| | Health & Wellbeing | 0 |
|
||||||
@ -30,11 +30,8 @@ Feature: Tags and Categories
|
|||||||
Scenario: See an overview of tags
|
Scenario: See an overview of tags
|
||||||
When I navigate to the administration dashboard
|
When I navigate to the administration dashboard
|
||||||
And I click on the menu item "Tags"
|
And I click on the menu item "Tags"
|
||||||
Then I can see a list of tags ordered by user count:
|
Then I can see the following table:
|
||||||
| # | Name | Users | Posts |
|
| | Name | Users | Posts |
|
||||||
| 1 | Democracy | 2 | 3 |
|
| 1 | Democracy | 2 | 3 |
|
||||||
| 2 | Ecology | 1 | 1 |
|
| 2 | Ecology | 1 | 1 |
|
||||||
| 3 | Nature | 1 | 2 |
|
| 3 | Nature | 1 | 2 |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -9,38 +9,13 @@ When('I navigate to the administration dashboard', () => {
|
|||||||
.click()
|
.click()
|
||||||
})
|
})
|
||||||
|
|
||||||
Then('I can see a list of categories ordered by post count:', table => {
|
Then('I can see the following table:', table => {
|
||||||
cy.get('thead')
|
const headers = table.raw()[0]
|
||||||
.find('tr th')
|
headers.forEach((expected, i) => {
|
||||||
.should('have.length', 3)
|
cy.get('thead th').eq(i).should('contain', expected)
|
||||||
table.hashes().forEach(({ Name, Posts }, index) => {
|
})
|
||||||
cy.get(`tbody > :nth-child(${index + 1}) > :nth-child(2)`).should(
|
const flattened = [].concat.apply([], table.rows())
|
||||||
'contain',
|
flattened.forEach((expected, i) => {
|
||||||
Name.trim()
|
cy.get('tbody td').eq(i).should('contain', expected)
|
||||||
)
|
|
||||||
cy.get(`tbody > :nth-child(${index + 1}) > :nth-child(3)`).should(
|
|
||||||
'contain',
|
|
||||||
Posts
|
|
||||||
)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
Then('I can see a list of tags ordered by user count:', table => {
|
|
||||||
cy.get('thead')
|
|
||||||
.find('tr th')
|
|
||||||
.should('have.length', 4)
|
|
||||||
table.hashes().forEach(({ Name, Users, Posts }, index) => {
|
|
||||||
cy.get(`tbody > :nth-child(${index + 1}) > :nth-child(2)`).should(
|
|
||||||
'contain',
|
|
||||||
Name.trim()
|
|
||||||
)
|
|
||||||
cy.get(`tbody > :nth-child(${index + 1}) > :nth-child(3)`).should(
|
|
||||||
'contain',
|
|
||||||
Users
|
|
||||||
)
|
|
||||||
cy.get(`tbody > :nth-child(${index + 1}) > :nth-child(4)`).should(
|
|
||||||
'contain',
|
|
||||||
Posts
|
|
||||||
)
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user