mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +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
|
||||
When I navigate to the administration dashboard
|
||||
And I click on the menu item "Categories"
|
||||
Then I can see a list of categories ordered by post count:
|
||||
| Icon | Name | Posts |
|
||||
Then I can see the following table:
|
||||
| | Name | Posts |
|
||||
| | Just For Fun | 2 |
|
||||
| | Happyness & Values | 1 |
|
||||
| | Health & Wellbeing | 0 |
|
||||
@ -30,11 +30,8 @@ Feature: Tags and Categories
|
||||
Scenario: See an overview of tags
|
||||
When I navigate to the administration dashboard
|
||||
And I click on the menu item "Tags"
|
||||
Then I can see a list of tags ordered by user count:
|
||||
| # | Name | Users | Posts |
|
||||
Then I can see the following table:
|
||||
| | Name | Users | Posts |
|
||||
| 1 | Democracy | 2 | 3 |
|
||||
| 2 | Ecology | 1 | 1 |
|
||||
| 3 | Nature | 1 | 2 |
|
||||
|
||||
|
||||
|
||||
|
||||
@ -9,38 +9,13 @@ When('I navigate to the administration dashboard', () => {
|
||||
.click()
|
||||
})
|
||||
|
||||
Then('I can see a list of categories ordered by post count:', table => {
|
||||
cy.get('thead')
|
||||
.find('tr th')
|
||||
.should('have.length', 3)
|
||||
table.hashes().forEach(({ Name, 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',
|
||||
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
|
||||
)
|
||||
Then('I can see the following table:', table => {
|
||||
const headers = table.raw()[0]
|
||||
headers.forEach((expected, i) => {
|
||||
cy.get('thead th').eq(i).should('contain', expected)
|
||||
})
|
||||
const flattened = [].concat.apply([], table.rows())
|
||||
flattened.forEach((expected, i) => {
|
||||
cy.get('tbody td').eq(i).should('contain', expected)
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user