mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
adapt feature step to selectFile
This commit is contained in:
parent
c1a4ba12da
commit
4efb6463a0
@ -1,28 +1,27 @@
|
|||||||
import { Then } from "@badeball/cypress-cucumber-preprocessor";
|
import { Then } from "@badeball/cypress-cucumber-preprocessor";
|
||||||
|
|
||||||
Then("I should be able to {string} a teaser image", condition => {
|
Then("I should be able to {string} a teaser image", condition => {
|
||||||
// cy.reload()
|
|
||||||
switch(condition){
|
switch(condition){
|
||||||
case 'change':
|
case "change":
|
||||||
cy.get('.delete-image-button')
|
cy.get(".delete-image-button")
|
||||||
.click()
|
.click()
|
||||||
cy.fixture('humanconnection.png').as('postTeaserImage').then(function() {
|
cy.fixture("humanconnection.png").as("postTeaserImage").then(function() {
|
||||||
cy.get("#postdropzone").upload(
|
cy.get("#postdropzone").selectFile(
|
||||||
{ fileContent: this.postTeaserImage, fileName: 'humanconnection.png', mimeType: "image/png" },
|
{ contents: this.postTeaserImage, fileName: "humanconnection.png", mimeType: "image/png" },
|
||||||
{ subjectType: "drag-n-drop", force: true }
|
{ action: "drag-drop" }
|
||||||
).wait(750);
|
).wait(750);
|
||||||
})
|
})
|
||||||
break;
|
break;
|
||||||
case 'add':
|
case "add":
|
||||||
cy.fixture('onourjourney.png').as('postTeaserImage').then(function() {
|
cy.fixture("onourjourney.png").as("postTeaserImage").then(function() {
|
||||||
cy.get("#postdropzone").upload(
|
cy.get("#postdropzone").selectFile(
|
||||||
{ fileContent: this.postTeaserImage, fileName: 'onourjourney.png', mimeType: "image/png" },
|
{ contents: this.postTeaserImage, fileName: "onourjourney.png", mimeType: "image/png" },
|
||||||
{ subjectType: "drag-n-drop", force: true }
|
{ action: "drag-drop" }
|
||||||
).wait(750);
|
).wait(750);
|
||||||
})
|
})
|
||||||
break;
|
break;
|
||||||
case 'remove':
|
case "remove":
|
||||||
cy.get('.delete-image-button')
|
cy.get(".delete-image-button")
|
||||||
.click()
|
.click()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,7 @@ Then("I should be able to change my profile picture", () => {
|
|||||||
cy.fixture(avatarUpload, "base64").then(fileContent => {
|
cy.fixture(avatarUpload, "base64").then(fileContent => {
|
||||||
cy.get("#customdropzone").selectFile(
|
cy.get("#customdropzone").selectFile(
|
||||||
{ fileName: avatarUpload, mimeType: "image/png" },
|
{ fileName: avatarUpload, mimeType: "image/png" },
|
||||||
{ action: 'drag-drop' }
|
{ action: "drag-drop" }
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
cy.get(".profile-page-avatar img")
|
cy.get(".profile-page-avatar img")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user