mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
e2e: refactor content reporting test steps
This commit is contained in:
parent
bdf9157eed
commit
0e100a9f1b
@ -1,14 +1,7 @@
|
||||
import { defineStep } from '@badeball/cypress-cucumber-preprocessor'
|
||||
|
||||
defineStep('I see all the reported posts including the one from above', () => {
|
||||
cy.intercept({
|
||||
method: 'POST',
|
||||
url: '/api',
|
||||
hostname: 'localhost',
|
||||
}).as('getReports')
|
||||
|
||||
cy.wait(['@getReports'],{ timeout: 30000 }).then((interception) => {
|
||||
console.log('Cypress interception:', interception)
|
||||
cy.wait('@reportsQuery', { timeout: 30000 }).then((interception) => {
|
||||
cy.wrap(interception.response.statusCode).should('eq', 200)
|
||||
cy.wrap(interception.request.body)
|
||||
.should('have.property', 'query', `query ($orderBy: ReportOrdering, $first: Int, $offset: Int, $reviewed: Boolean, $closed: Boolean) {
|
||||
@ -104,6 +97,6 @@ defineStep('I see all the reported posts including the one from above', () => {
|
||||
})
|
||||
|
||||
cy.get('table tbody').within(() => {
|
||||
cy.contains('tr', 'The Truth about the Holocaust')
|
||||
cy.contains('tr', 'The Truth about the Holocaust').should('be.visible')
|
||||
})
|
||||
})
|
||||
})
|
||||
Loading…
x
Reference in New Issue
Block a user