mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
All cucumbers have passed
This commit is contained in:
parent
96a30ca03e
commit
c8f23f9e6e
@ -16,10 +16,9 @@ Feature: Tags and Categories
|
|||||||
Background:
|
Background:
|
||||||
Given we have a selection of tags and categories as well as posts
|
Given we have a selection of tags and categories as well as posts
|
||||||
And my user account has the role "administrator"
|
And my user account has the role "administrator"
|
||||||
|
|
||||||
@focus
|
|
||||||
Scenario: See an overview of categories
|
|
||||||
Given I am logged in
|
Given I am logged in
|
||||||
|
|
||||||
|
Scenario: See an overview of categories
|
||||||
When I navigate to the administration dashboard
|
When I navigate to the administration dashboard
|
||||||
And I click on "Categories"
|
And I click on "Categories"
|
||||||
Then I can see a list of categories ordered by post count:
|
Then I can see a list of categories ordered by post count:
|
||||||
@ -31,7 +30,7 @@ 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 "Tags"
|
And I click on "Tags"
|
||||||
Then I can see a list of categories ordered by post count:
|
Then I can see a list of tags ordered by user and post count:
|
||||||
| # | Name | Nutzer | Beiträge |
|
| # | Name | Nutzer | Beiträge |
|
||||||
| 1 | Naturschutz | 2 | 2 |
|
| 1 | Naturschutz | 2 | 2 |
|
||||||
| 2 | Freiheit | 2 | 2 |
|
| 2 | Freiheit | 2 | 2 |
|
||||||
|
|||||||
@ -85,8 +85,8 @@ When('I navigate to the administration dashboard', () => {
|
|||||||
cy.get('a').contains('Systemverwaltung').click()
|
cy.get('a').contains('Systemverwaltung').click()
|
||||||
})
|
})
|
||||||
|
|
||||||
When(`I click on {string}`, (link) => {
|
When(`I click on {string}`, (linkOrButton) => {
|
||||||
cy.contains(link).click()
|
cy.contains(linkOrButton).click()
|
||||||
})
|
})
|
||||||
|
|
||||||
Then('I can see a list of categories ordered by post count:', (table) => {
|
Then('I can see a list of categories ordered by post count:', (table) => {
|
||||||
@ -99,3 +99,14 @@ Then('I can see a list of categories ordered by post count:', (table) => {
|
|||||||
return cy.wrap(values).should('deep.eq', ordered_descending)
|
return cy.wrap(values).should('deep.eq', ordered_descending)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Then('I can see a list of tags ordered by user and post count:', (table) => {
|
||||||
|
// TODO: match the table in the feature with the html table
|
||||||
|
cy.get('thead').find('tr th').should('have.length', 4)
|
||||||
|
const last_column = cy.get('tbody').find('tr td:last-child').then((last_column) => {
|
||||||
|
cy.wrap(last_column)
|
||||||
|
const values = last_column.map((i, td) => parseInt(td.textContent)).toArray()
|
||||||
|
const ordered_descending = values.slice(0).sort((a,b) => b - a)
|
||||||
|
return cy.wrap(values).should('deep.eq', ordered_descending)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user