mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
remove unnecessary cypress code from step definitions
This commit is contained in:
parent
f44dda4127
commit
242619d21b
@ -1,24 +1,24 @@
|
||||
import { Then } from "@badeball/cypress-cucumber-preprocessor";
|
||||
|
||||
Then("I should be able to {string} a teaser image", condition => {
|
||||
let postTeaserImage = ""
|
||||
|
||||
switch(condition){
|
||||
case "change":
|
||||
postTeaserImage = "humanconnection.png"
|
||||
cy.get(".delete-image-button")
|
||||
.click()
|
||||
cy.fixture("humanconnection.png").as("postTeaserImage").then(function() {
|
||||
cy.get("#postdropzone").selectFile(
|
||||
{ contents: this.postTeaserImage, fileName: "humanconnection.png", mimeType: "image/png" },
|
||||
{ action: "drag-drop" }
|
||||
).wait(750);
|
||||
})
|
||||
cy.get("#postdropzone").selectFile(
|
||||
{ contents: `cypress/fixtures/${postTeaserImage}`, fileName: postTeaserImage, mimeType: "image/png" },
|
||||
{ action: "drag-drop" }
|
||||
).wait(750);
|
||||
break;
|
||||
case "add":
|
||||
cy.fixture("onourjourney.png").as("postTeaserImage").then(function() {
|
||||
cy.get("#postdropzone").selectFile(
|
||||
{ contents: this.postTeaserImage, fileName: "onourjourney.png", mimeType: "image/png" },
|
||||
{ action: "drag-drop" }
|
||||
).wait(750);
|
||||
})
|
||||
postTeaserImage = "onourjourney.png"
|
||||
cy.get("#postdropzone").selectFile(
|
||||
{ contents: `cypress/fixtures/${this.postTeaserImage}`, fileName: postTeaserImage, mimeType: "image/png" },
|
||||
{ action: "drag-drop" }
|
||||
).wait(750);
|
||||
break;
|
||||
case "remove":
|
||||
cy.get(".delete-image-button")
|
||||
|
||||
@ -2,13 +2,11 @@ import { Then } from "@badeball/cypress-cucumber-preprocessor";
|
||||
|
||||
Then("I should be able to change my profile picture", () => {
|
||||
const avatarUpload = "onourjourney.png";
|
||||
|
||||
cy.fixture(avatarUpload, "base64").then(fileContent => {
|
||||
cy.get("#customdropzone").selectFile(
|
||||
{ contents: `cypress/fixtures/${avatarUpload}`, fileName: avatarUpload, mimeType: "image/png" },
|
||||
{ action: "drag-drop" }
|
||||
);
|
||||
});
|
||||
|
||||
cy.get("#customdropzone").selectFile(
|
||||
{ contents: `cypress/fixtures/${avatarUpload}`, fileName: avatarUpload, mimeType: "image/png" },
|
||||
{ action: "drag-drop" }
|
||||
);
|
||||
cy.get(".profile-page-avatar img")
|
||||
.should("have.attr", "src")
|
||||
.and("contains", "onourjourney");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user