-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6008 from Ocelot-Social-Community/cypress-migrate…
…-to-v10 test(other): migrate cypress to v12
- Loading branch information
Showing
156 changed files
with
2,430 additions
and
2,926 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,37 @@ | ||
// NOTE: We cannot use `fs` here to clean up the code. Cypress breaks on any npm | ||
// module that is not browser-compatible. Node's `fs` module is server-side only | ||
export default { | ||
Image: require('./Image.js').default, | ||
Badge: require('./Badge.js').default, | ||
User: require('./User.js').default, | ||
Group: require('./Group.js').default, | ||
EmailAddress: require('./EmailAddress.js').default, | ||
UnverifiedEmailAddress: require('./UnverifiedEmailAddress.js').default, | ||
SocialMedia: require('./SocialMedia.js').default, | ||
Post: require('./Post.js').default, | ||
Comment: require('./Comment.js').default, | ||
Category: require('./Category.js').default, | ||
Tag: require('./Tag.js').default, | ||
Location: require('./Location.js').default, | ||
Donations: require('./Donations.js').default, | ||
Report: require('./Report.js').default, | ||
Migration: require('./Migration.js').default, | ||
InviteCode: require('./InviteCode.js').default, | ||
Image: typeof Cypress !== 'undefined' ? require('./Image.js') : require('./Image.js').default, | ||
Badge: typeof Cypress !== 'undefined' ? require('./Badge.js') : require('./Badge.js').default, | ||
User: typeof Cypress !== 'undefined' ? require('./User.js') : require('./User.js').default, | ||
Group: typeof Cypress !== 'undefined' ? require('./Group.js') : require('./Group.js').default, | ||
EmailAddress: | ||
typeof Cypress !== 'undefined' | ||
? require('./EmailAddress.js') | ||
: require('./EmailAddress.js').default, | ||
UnverifiedEmailAddress: | ||
typeof Cypress !== 'undefined' | ||
? require('./UnverifiedEmailAddress.js') | ||
: require('./UnverifiedEmailAddress.js').default, | ||
SocialMedia: | ||
typeof Cypress !== 'undefined' | ||
? require('./SocialMedia.js') | ||
: require('./SocialMedia.js').default, | ||
Post: typeof Cypress !== 'undefined' ? require('./Post.js') : require('./Post.js').default, | ||
Comment: | ||
typeof Cypress !== 'undefined' ? require('./Comment.js') : require('./Comment.js').default, | ||
Category: | ||
typeof Cypress !== 'undefined' ? require('./Category.js') : require('./Category.js').default, | ||
Tag: typeof Cypress !== 'undefined' ? require('./Tag.js') : require('./Tag.js').default, | ||
Location: | ||
typeof Cypress !== 'undefined' ? require('./Location.js') : require('./Location.js').default, | ||
Donations: | ||
typeof Cypress !== 'undefined' ? require('./Donations.js') : require('./Donations.js').default, | ||
Report: typeof Cypress !== 'undefined' ? require('./Report.js') : require('./Report.js').default, | ||
Migration: | ||
typeof Cypress !== 'undefined' ? require('./Migration.js') : require('./Migration.js').default, | ||
InviteCode: | ||
typeof Cypress !== 'undefined' | ||
? require('./InviteCode.js') | ||
: require('./InviteCode.js').default, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
const dotenv = require('dotenv') | ||
const { defineConfig } = require("cypress"); | ||
const browserify = require("@badeball/cypress-cucumber-preprocessor/browserify"); | ||
const { addCucumberPreprocessorPlugin } = require("@badeball/cypress-cucumber-preprocessor"); | ||
|
||
// Test persistent(between commands) store | ||
const testStore = {} | ||
|
||
async function setupNodeEvents(on, config) { | ||
await addCucumberPreprocessorPlugin(on, config); | ||
|
||
on("file:preprocessor", browserify.default(config)); | ||
|
||
on("task", { | ||
pushValue({ name, value }) { | ||
testStore[name] = value | ||
return true | ||
}, | ||
getValue(name) { | ||
console.log("getValue",name,testStore) | ||
return testStore[name] | ||
}, | ||
}); | ||
|
||
on("after:run", (results) => { | ||
if (results) { | ||
console.log(results.status); | ||
} | ||
}); | ||
|
||
return config; | ||
} | ||
|
||
// Import backend .env (smart)? | ||
const { parsed } = dotenv.config({ path: '../backend/.env' }) | ||
|
||
module.exports = defineConfig({ | ||
e2e: { | ||
projectId: "qa7fe2", | ||
defaultCommandTimeout: 10000, | ||
chromeWebSecurity: false, | ||
baseUrl: "http://localhost:3000", | ||
specPattern: "cypress/e2e/**/*.feature", | ||
supportFile: "cypress/support/e2e.js", | ||
retries: { | ||
runMode: 2, | ||
openMode: 0, | ||
}, | ||
video: false, | ||
setupNodeEvents, | ||
}, | ||
env: parsed | ||
}); |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 0 additions & 5 deletions
5
cypress/integration/User.SettingNotifications/I_click_save.js
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
...on/User.SettingNotifications/I_click_the_checkbox_show_donations_progress_bar_and_save.js
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
cypress/integration/UserProfile.ChangePassword/I_submit_the_form.js
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ns_goal_{string}_and_progress_{string}.js → ...ns_goal_{string}_and_progress_{string}.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { When } from "cypress-cucumber-preprocessor/steps"; | ||
import { When } from "@badeball/cypress-cucumber-preprocessor"; | ||
|
||
When("the donation info contains goal {string} and progress {string}", (goal, progress) => { | ||
cy.get('.top-info-bar') | ||
.should('contain', goal) | ||
cy.get('.top-info-bar') | ||
.should('contain', progress) | ||
}); | ||
}); |
4 changes: 2 additions & 2 deletions
4
...tionInfo/the_donation_info_is_{string}.js → ...tionInfo/the_donation_info_is_{string}.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { Then } from "cypress-cucumber-preprocessor/steps"; | ||
import { Then } from "@badeball/cypress-cucumber-preprocessor"; | ||
|
||
Then("the donation info is {string}", (visibility) => { | ||
cy.get('.top-info-bar') | ||
.should(visibility === 'visible' ? 'exist' : 'not.exist') | ||
}) | ||
}) |
4 changes: 2 additions & 2 deletions
4
...open_the_content_menu_of_post_{string}.js → ...open_the_content_menu_of_post_{string}.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { When } from "cypress-cucumber-preprocessor/steps"; | ||
import { When } from "@badeball/cypress-cucumber-preprocessor"; | ||
|
||
When("I open the content menu of post {string}", (title) => { | ||
cy.contains('.post-teaser', title) | ||
.find('.content-menu .base-button') | ||
.click() | ||
}) | ||
}) |
4 changes: 2 additions & 2 deletions
4
...{string}_has_a_ribbon_for_pinned_posts.js → ...{string}_has_a_ribbon_for_pinned_posts.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { Then } from "cypress-cucumber-preprocessor/steps"; | ||
import { Then } from "@badeball/cypress-cucumber-preprocessor"; | ||
|
||
Then("the post with title {string} has a ribbon for pinned posts", (title) => { | ||
cy.get(".post-teaser").contains(title) | ||
.parent() | ||
.parent() | ||
.find(".ribbon.--pinned") | ||
.should("contain", "Announcement") | ||
}) | ||
}) |
4 changes: 2 additions & 2 deletions
4
...nPost/there_is_no_button_to_pin_a_post.js → ...nPost/there_is_no_button_to_pin_a_post.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { Then } from "cypress-cucumber-preprocessor/steps"; | ||
import { Then } from "@badeball/cypress-cucumber-preprocessor"; | ||
|
||
Then("there is no button to pin a post", () => { | ||
cy.get("a.ds-menu-item-link") | ||
.should('contain', "Report Post") // sanity check | ||
.should('not.contain', "Pin post") | ||
}) | ||
}) |
4 changes: 2 additions & 2 deletions
4
...I_see_a_button_with_the_label_{string}.js → ...I_see_a_button_with_the_label_{string}.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { Then } from "cypress-cucumber-preprocessor/steps"; | ||
import { Then } from "@badeball/cypress-cucumber-preprocessor"; | ||
|
||
Then("I see a button with the label {string}", label => { | ||
cy.contains("button", label); | ||
}); | ||
}); |
4 changes: 2 additions & 2 deletions
4
...I_select_{string}_in_the_language_menu.js → ...I_select_{string}_in_the_language_menu.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { When } from "cypress-cucumber-preprocessor/steps"; | ||
import { When } from "@badeball/cypress-cucumber-preprocessor"; | ||
|
||
When("I select {string} in the language menu", language => { | ||
cy.get(".locale-menu") | ||
.click(); | ||
cy.contains(".locale-menu-popover a", language) | ||
.click(); | ||
}); | ||
}); |
6 changes: 3 additions & 3 deletions
6
...ole_user_interface_appears_in_{string}.js → ...ole_user_interface_appears_in_{string}.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { Then } from "cypress-cucumber-preprocessor/steps"; | ||
import locales from '../../../webapp/locales' | ||
import { Then } from "@badeball/cypress-cucumber-preprocessor"; | ||
import locales from '../../../../webapp/locales' | ||
|
||
Then("the whole user interface appears in {string}", language => { | ||
const { code } = locales.find((entry) => entry.name === language); | ||
cy.get(`html[lang=${code}]`); | ||
cy.getCookie("locale").should("have.property", "value", code); | ||
}); | ||
}); |
4 changes: 2 additions & 2 deletions
4
...d_see_only_{int}_posts_on_the_newsfeed.js → ...d_see_only_{int}_posts_on_the_newsfeed.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { Then } from "cypress-cucumber-preprocessor/steps"; | ||
import { Then } from "@badeball/cypress-cucumber-preprocessor"; | ||
|
||
Then("I should see only {int} posts on the newsfeed", posts => { | ||
cy.get(".post-teaser") | ||
.should("have.length", posts); | ||
}); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.