From 7181f03fdf1e2e52845178988f8bcfd9a40f5a07 Mon Sep 17 00:00:00 2001 From: Matt Rider Date: Sat, 27 Apr 2019 18:00:37 -0300 Subject: [PATCH] Fix flaky cypress test --- cypress/integration/common/report.js | 26 +++++++----------- .../moderation/ReportContent.feature | 27 ++++++++++--------- webapp/pages/profile/_id/_slug.vue | 1 + 3 files changed, 25 insertions(+), 29 deletions(-) diff --git a/cypress/integration/common/report.js b/cypress/integration/common/report.js index a6c13c3e6..2c8b848b4 100644 --- a/cypress/integration/common/report.js +++ b/cypress/integration/common/report.js @@ -49,26 +49,20 @@ When('I click on "Report Post" from the content menu of the post', () => { .click() }) -When( - 'I click on "Report User" from the content menu in the user info box', - () => { - // wait client-side-rendered content - cy.get('.ds-card-content .content-menu button').should('exist') +When('I click on "Report User" from the content menu in the user info box', () => { + cy.contains('.ds-card', davidIrvingPostTitle) + .get('.user-content-menu .content-menu-trigger') + .click({ force: true }) - cy.contains('.ds-card-content', davidIrvingName) - .find('.content-menu button').click() - - cy.get('.popover .ds-menu-item-link') - .contains('Report User') - .click() - } -) + cy.get('.popover .ds-menu-item-link') + .contains('Report User') + .click() +}) When('I click on the author', () => { - cy.get('a.user') - .first() + cy.get('.username') .click() - .wait(200) + .url().should('include', '/profile/') }) When('I report the author', () => { diff --git a/cypress/integration/moderation/ReportContent.feature b/cypress/integration/moderation/ReportContent.feature index 52f7218d4..62fb4f421 100644 --- a/cypress/integration/moderation/ReportContent.feature +++ b/cypress/integration/moderation/ReportContent.feature @@ -1,6 +1,6 @@ Feature: Report and Moderate As a user - I would like to report content that viloates the community guidlines + I would like to report content that violates the community guidlines So the moderators can take action on it As a moderator @@ -12,18 +12,19 @@ Feature: Report and Moderate | 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 When I see David Irving's post on the And I click on "Report Post" from the content menu of the post And I confirm the reporting dialog because it is a criminal act under German law: - """ - Do you really want to report the contribution "The Truth about the Holocaust"? - """ + """ + Do you really want to report the contribution "The Truth about the Holocaust"? + """ Then I see a success message: - """ - Thanks for reporting! - """ + """ + Thanks for reporting! + """ Examples: | Page | | landing page | @@ -35,13 +36,13 @@ Feature: Report and Moderate When I click on the author And I click on "Report User" from the content menu in the user info box And I confirm the reporting dialog because he is a holocaust denier: - """ - Do you really want to report the user "David Irving"? - """ + """ + Do you really want to report the user "David Irving"? + """ Then I see a success message: - """ - Thanks for reporting! - """ + """ + Thanks for reporting! + """ Scenario: Review reported content Given somebody reported the following posts: diff --git a/webapp/pages/profile/_id/_slug.vue b/webapp/pages/profile/_id/_slug.vue index 89ca09ab9..d577b79c8 100644 --- a/webapp/pages/profile/_id/_slug.vue +++ b/webapp/pages/profile/_id/_slug.vue @@ -26,6 +26,7 @@ resource-type="user" :resource="user" :is-owner="myProfile" + class="user-content-menu" />