diff --git a/cypress/integration/05.ReportContent.feature b/cypress/integration/05.ReportContent.feature index 25f5aec94..76ebb4fcd 100644 --- a/cypress/integration/05.ReportContent.feature +++ b/cypress/integration/05.ReportContent.feature @@ -9,8 +9,8 @@ Feature: Report and Moderate Background: Given we have the following posts in our database: - | Author | title | content | - | David Irving | The Truth about the Holocaust | It never existed! | + | Author | id | title | content | + | David Irving | p1 | The Truth about the Holocaust | It never existed! | Scenario Outline: Report a post from various pages Given I am logged in with a "user" role @@ -45,8 +45,8 @@ Feature: Report and Moderate Scenario: Review reported content Given somebody reported the following posts: - | Slug | - | the-truth-about-the-holocaust | + | id | + | p1 | And I am logged in with a "moderator" role When I click on the avatar menu in the top right corner And I click on "Moderation" diff --git a/cypress/integration/common/report.js b/cypress/integration/common/report.js index 0b0d3f253..f9b232d29 100644 --- a/cypress/integration/common/report.js +++ b/cypress/integration/common/report.js @@ -125,27 +125,17 @@ When(/^I confirm the reporting dialog .*:$/, () => { }) Given('somebody reported the following posts:', table => { - table.hashes().forEach(({ slug }, index) => { - const author = { - id: `author${index}`, - email: `author${index}@example.org`, - password: '1234' - } + table.hashes().forEach(({ id }) => { const reporter = { - id: `reporter${index}`, - email: `reporter${index}@example.org`, + email: `reporter${id}@example.org`, password: '1234' } - cy.factory() - .create('user', author) - .authenticateAs(author) - .create('post', { id: `p${index}` }) cy.factory() .create('user', reporter) .authenticateAs(reporter) .create('report', { description: "I don't like this post", - resource: { id: `p${index}`, type: 'post' } + resource: { id, type: 'contribution' } }) }) }) diff --git a/cypress/integration/common/steps.js b/cypress/integration/common/steps.js index a0d348437..5e816c5ce 100644 --- a/cypress/integration/common/steps.js +++ b/cypress/integration/common/steps.js @@ -139,7 +139,7 @@ When('I press {string}', label => { }) Given('we have the following posts in our database:', table => { - table.hashes().forEach(({ Author, title, content }) => { + table.hashes().forEach(({ Author, id, title, content }) => { cy.factory() .create('user', { name: Author, @@ -150,7 +150,7 @@ Given('we have the following posts in our database:', table => { email: `${Author}@example.org`, password: '1234' }) - .create('post', { title, content }) + .create('post', { id, title, content }) }) })