Cypress: update import of current cucumber preprocessor in step definition files

This commit is contained in:
mahula 2022-11-06 16:56:21 +01:00
parent b38769b048
commit 9c0a71f72f
115 changed files with 229 additions and 226 deletions

View File

@ -1,6 +1,6 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("I click the checkbox show donations progress bar and save", () => {
cy.get("#showDonations").click()
cy.get(".donations-info-button").click()
})
})

View File

@ -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)
});
});

View File

@ -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')
})
})

View File

@ -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()
})
})

View File

@ -1,4 +1,4 @@
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)
@ -6,4 +6,4 @@ Then("the post with title {string} has a ribbon for pinned posts", (title) => {
.parent()
.find(".ribbon.--pinned")
.should("contain", "Announcement")
})
})

View File

@ -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")
})
})

View File

@ -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);
});
});

View File

@ -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();
});
});

View File

@ -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);
});
});

View File

@ -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);
});

View File

@ -1,4 +1,4 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("the page {string} returns a 404 error with a message:", (route, message) => {
cy.request({
@ -11,4 +11,4 @@ Then("the page {string} returns a 404 error with a message:", (route, message) =
failOnStatusCode: false
});
cy.get(".error-message").should("contain", message);
});
});

View File

@ -1,4 +1,4 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then(`I can't see the moderation menu item`, () => {
cy.get('.avatar-menu-popover')
@ -8,4 +8,4 @@ Then(`I can't see the moderation menu item`, () => {
cy.get('.avatar-menu-popover')
.find('a[href="/moderation"]', 'Moderation')
.should('not.exist')
})
})

View File

@ -1,7 +1,7 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then('I can visit the post page', () => {
cy.contains('Fake news').click()
cy.location('pathname').should('contain', '/post')
.get('.base-card .title').should('contain', 'Fake news')
})
})

View File

@ -1,4 +1,4 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
When('I click on "Report Post" from the content menu of the post', () => {
cy.contains('.base-card', 'The Truth about the Holocaust')
@ -8,4 +8,4 @@ When('I click on "Report Post" from the content menu of the post', () => {
cy.get('.popover .ds-menu-item-link')
.contains('Report Post')
.click()
})
})

View File

@ -1,7 +1,7 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
When('I click on the author', () => {
cy.get('[data-test="avatarUserLink"]')
.click()
.url().should('include', '/profile/')
})
})

View File

@ -1,7 +1,7 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
import 'cypress-network-idle';
When("I click on the avatar menu in the top right corner", () => {
cy.get(".avatar-menu").click();
cy.waitForNetworkIdle(2000);
});
});

View File

@ -1,4 +1,4 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
When(/^I confirm the reporting dialog .*:$/, message => {
cy.contains(message) // wait for element to become visible
@ -13,4 +13,4 @@ When(/^I confirm the reporting dialog .*:$/, message => {
.contains('Report')
.click()
})
})
})

View File

@ -1,7 +1,7 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then('I see all the reported posts including from the user who muted me', () => {
cy.get('table tbody').within(() => {
cy.contains('tr', 'Fake news')
})
})
})

View File

@ -1,4 +1,4 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then('I see all the reported posts including the one from above', () => {
cy.intercept({

View File

@ -1,6 +1,6 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then('each list item links to the post page', () => {
cy.contains('The Truth about the Holocaust').click();
cy.location('pathname').should('contain', '/post')
})
})

View File

@ -1,4 +1,4 @@
import { Given } from "cypress-cucumber-preprocessor/steps";
import { Given } from "@badeball/cypress-cucumber-preprocessor";
import 'cypress-network-idle';
Given('somebody reported the following posts:', table => {
@ -37,4 +37,4 @@ Given('somebody reported the following posts:', table => {
})
cy.waitForNetworkIdle(2000)
})
})
})

View File

@ -1,3 +1,5 @@
import { Given } from "@badeball/cypress-cucumber-preprocessor";
Given("there is an annoying user who has muted me", () => {
cy.neode()
.first("User", {
@ -10,4 +12,4 @@ Given("there is an annoying user who has muted me", () => {
})
.relateTo(mutedUser, "muted");
});
});
});

View File

@ -1,8 +1,8 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
When("I start to write a new post with the title {string} beginning with:", (title, intro) => {
cy.get('input[name="title"]')
.type(title);
cy.get(".ProseMirror")
.type(intro);
});
});

View File

@ -1,4 +1,4 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
When("mention {string} in the text", mention => {
cy.get(".ProseMirror")
@ -6,4 +6,4 @@ When("mention {string} in the text", mention => {
cy.get(".suggestion-list__item")
.contains(mention)
.click();
});
});

View File

@ -1,4 +1,4 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
When("open the notification menu and click on the first item", () => {
cy.get(".notifications-menu")
@ -7,4 +7,4 @@ When("open the notification menu and click on the first item", () => {
cy.get(".notification .link")
.first()
.click({force: true});
});
});

View File

@ -1,6 +1,6 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("see {int} unread notifications in the top menu", count => {
cy.get(".notifications-menu")
.should("contain", count);
});
});

View File

@ -1,8 +1,8 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("the notification menu button links to the all notifications page", () => {
cy.get(".notifications-menu")
.click();
cy.location("pathname")
.should("contain", "/notifications");
});
});

View File

@ -1,6 +1,6 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("the unread counter is removed", () => {
cy.get('.notifications-menu .counter-icon')
.should('not.exist');
});
});

View File

@ -1,7 +1,7 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
When("I comment the following:", async text => {
const comment = text.replace("\n", " ")
cy.task('pushValue', { name: 'lastComment', value: comment })
cy.get(".editor .ProseMirror").type(comment);
});
});

View File

@ -1,6 +1,6 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("I should see an abbreviated version of my comment", () => {
cy.get("article.comment-card")
.should("contain", "show more")
});
});

View File

@ -1,4 +1,4 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("I should see my comment", () => {
cy.get("article.comment-card p")
@ -10,4 +10,4 @@ Then("I should see my comment", () => {
.and("contain", 'https://') // some url
.get(".user-teaser > .info > .text")
.should("contain", "today at");
});
});

View File

@ -1,6 +1,6 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("I should see the entirety of my comment", () => {
cy.get("article.comment-card")
.should("not.contain", "show more")
});
});

View File

@ -1,4 +1,4 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
When("I type in a comment with {int} characters", size => {
var c="";
@ -6,4 +6,4 @@ When("I type in a comment with {int} characters", size => {
c += "c"
}
cy.get(".editor .ProseMirror").type(c);
});
});

View File

@ -1,7 +1,7 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("it should create a mention in the CommentForm", () => {
cy.get(".ProseMirror a")
.should('have.class', 'mention')
.should('contain', '@peter-pan')
})
})

View File

@ -1,5 +1,5 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("my comment should be successfully created", () => {
cy.get(".iziToast-message").contains("Comment submitted!");
});
});

View File

@ -1,5 +1,5 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("the editor should be cleared", () => {
cy.get(".ProseMirror p").should("have.class", "is-empty");
});
});

View File

@ -1,8 +1,8 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
When("I choose {string} as the title", async title => {
const lastPost = {}
lastPost.title = title.replace("\n", " ");
cy.task('pushValue', { name: 'lastPost', value: lastPost })
cy.get('input[name="title"]').type(lastPost.title);
});
});

View File

@ -1,8 +1,8 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("the post was saved successfully", async () => {
cy.task('getValue', 'lastPost').then(lastPost => {
cy.get(".base-card > .title").should("contain", lastPost.title);
cy.get(".content").should("contain", lastPost.content);
})
});
});

View File

@ -1,8 +1,8 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("I add all required fields", () => {
cy.get('input[name="title"]')
.type('new post')
.get(".editor .ProseMirror")
.type('new post content')
})
})

View File

@ -1,4 +1,4 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("I should be able to {string} a teaser image", condition => {
// cy.reload()
@ -27,4 +27,4 @@ Then("I should be able to {string} a teaser image", condition => {
break;
}
})
})

View File

@ -1,7 +1,7 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
When('my post has a teaser image', () => {
cy.get('.contribution-form .image')
.should('exist')
.and('have.attr', 'src')
})
})

View File

@ -1,4 +1,4 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("the first image should not be displayed anymore", () => {
cy.get(".hero-image")
@ -6,4 +6,4 @@ Then("the first image should not be displayed anymore", () => {
.get('.hero-image > .image')
.should('have.length', 1)
.and('have.attr', 'src')
})
})

View File

@ -1,4 +1,4 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("the post was saved successfully with the {string} teaser image", condition => {
cy.get(".base-card > .title")
@ -8,4 +8,4 @@ Then("the post was saved successfully with the {string} teaser image", condition
.get('.post-page img')
.should("have.attr", "src")
.and("contains", condition === 'updated' ? 'humanconnection' : 'onourjourney')
})
})

View File

@ -1,4 +1,4 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then('the {string} post was saved successfully without a teaser image', condition => {
cy.get(".base-card > .title")
@ -9,4 +9,4 @@ Then('the {string} post was saved successfully without a teaser image', conditio
.should('exist')
.get('.hero-image > .image')
.should('not.exist')
})
})

View File

@ -1,8 +1,8 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("the post shows up on the newsfeed at position {int}", index => {
const selector = `.post-teaser:nth-child(${index}) > .base-card`;
cy.get(selector).should("contain", 'previously created post');
cy.get(selector).should("contain", 'with some content');
});
});

View File

@ -1,7 +1,7 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
When("I select a post entry", () => {
cy.get(".searchable-input .search-post")
.first()
.trigger("click");
});
});

View File

@ -1,7 +1,7 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("I select a user entry", () => {
cy.get(".searchable-input .user-teaser")
.first()
.trigger("click");
})
})

View File

@ -1,7 +1,7 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("I should have one item in the select dropdown", () => {
cy.get(".searchable-input .ds-select-dropdown").should($li => {
expect($li).to.have.length(1);
});
});
});

View File

@ -1,6 +1,6 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("I should not see posts without the searched-for term in the select dropdown", () => {
cy.get(".ds-select-dropdown")
.should("not.contain","No searched for content");
});
});

View File

@ -1,6 +1,6 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("I should see posts with the searched-for term in the select dropdown", () => {
cy.get(".ds-select-dropdown")
.should("contain","101 Essays that will change the way you think");
});
});

View File

@ -1,8 +1,8 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("I should see the following posts on the search results page:", table => {
table.hashes().forEach(({ title }) => {
cy.get(".post-teaser")
.should("contain",title)
});
});
});

View File

@ -1,8 +1,8 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("I should see the following users in the select dropdown:", table => {
cy.get(".search-heading").should("contain", "Users");
table.hashes().forEach(({ slug }) => {
cy.get(".ds-select-dropdown").should("contain", slug);
});
});
});

View File

@ -1,8 +1,8 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
When("I type {string} and press Enter", value => {
cy.get(".searchable-input .ds-select input")
.focus()
.type(value)
.type("{enter}", { force: true });
});
});

View File

@ -1,8 +1,8 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
When("I type {string} and press escape", value => {
cy.get(".searchable-input .ds-select input")
.focus()
.type(value)
.type("{esc}");
});
});

View File

@ -1,6 +1,6 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("the search field should clear", () => {
cy.get(".searchable-input .ds-select input")
.should("have.text", "");
});
});

View File

@ -1,6 +1,6 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("the search parameter equals {string}", search => {
cy.location("search")
.should("eq", search);
});
});

View File

@ -1,7 +1,7 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("I am logged in with username {string}", name => {
cy.get(".avatar-menu").click();
cy.get(".avatar-menu-popover").contains(name);
cy.get(".avatar-menu").click(); // Close menu again
});
});

View File

@ -1,4 +1,4 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
When("I block the user {string}", name => {
cy.neode()
@ -8,4 +8,4 @@ When("I block the user {string}", name => {
.first("User", {id: "id-of-peter-pan"})
.relateTo(blockedUser, "blocked");
});
});
});

View File

@ -1,6 +1,6 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then('I should not see {string} button', button => {
cy.get('.base-card .action-buttons')
.should('have.length', 1)
})
})

View File

@ -1,6 +1,6 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("I should see no users in my blocked users list", () => {
cy.get('.ds-placeholder')
.should('contain', "So far, you have not blocked anybody.")
})
})

View File

@ -1,6 +1,6 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then('I should see the {string} button', button => {
cy.get('.base-card .action-buttons .base-button')
.should('contain', button)
})
})

View File

@ -1,7 +1,7 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("I {string} see {string} from the content menu in the user info box", (condition, link) => {
cy.get(".user-content-menu .base-button").click()
cy.get(".popover .ds-menu-item-link")
.should(condition === 'should' ? 'contain' : 'not.contain', link)
})
})

View File

@ -1,4 +1,4 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
When("a user has blocked me", () => {
cy.neode()
@ -12,4 +12,4 @@ When("a user has blocked me", () => {
})
.relateTo(blockedUser, "blocked");
});
});
});

View File

@ -1,5 +1,5 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("they should not see the comment form", () => {
cy.get(".base-card").children().should('not.have.class', 'comment-form')
})
})

View File

@ -1,5 +1,5 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("they should see a text explaining why commenting is not possible", () => {
cy.get('.ds-placeholder').should('contain', "Commenting is not possible at this time on this post.")
})
})

View File

@ -1,4 +1,4 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
When("I mute the user {string}", name => {
cy.neode()
@ -10,4 +10,4 @@ When("I mute the user {string}", name => {
})
.relateTo(mutedUser, "muted");
});
});
});

View File

@ -1,6 +1,6 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("the list of posts of this user is empty", () => {
cy.get(".base-card").not(".post-link");
cy.get(".main-container").find(".ds-space.hc-empty");
});
});

View File

@ -1,4 +1,4 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("the search should contain the annoying user", () => {
cy.get(".searchable-input .ds-select-dropdown")
@ -10,4 +10,4 @@ Then("the search should contain the annoying user", () => {
cy.get(".searchable-input .ds-select input")
.focus()
.type("{esc}");
})
})

View File

@ -1,4 +1,4 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("the search should not contain posts by the annoying user", () => {
cy.get(".searchable-input .ds-select-dropdown").should($li => {
@ -7,4 +7,4 @@ Then("the search should not contain posts by the annoying user", () => {
cy.get(".ds-select-dropdown")
.should("not.have.class", '.search-post')
.should("not.contain", 'Spam')
});
});

View File

@ -1,4 +1,4 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
When("I click on element with ID {string}", (id) => {
cy.get('#' + id).click()

View File

@ -1,5 +1,5 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("I click save", () => {
cy.get(".save-button").click()
})
})

View File

@ -1,6 +1,6 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("I click the checkbox show donations progress bar and save", () => {
cy.get("#showDonations").click()
cy.get(".donations-info-button").click()
})
})

View File

@ -1,8 +1,8 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("I cannot upload a picture", () => {
cy.get(".base-card")
.children()
.should("not.have.id", "customdropzone")
.should("have.class", "profile-avatar");
});
});

View File

@ -1,4 +1,4 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("I should be able to change my profile picture", () => {
const avatarUpload = "onourjourney.png";
@ -14,4 +14,4 @@ Then("I should be able to change my profile picture", () => {
.and("contains", "onourjourney");
cy.contains(".iziToast-message", "Upload successful")
.should("have.length",1);
});
});

View File

@ -1,7 +1,7 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("I can login successfully", () => {
// cy.reload();
cy.get(".iziToast-wrapper")
.should("contain", "You are logged in!");
});
});

View File

@ -1,7 +1,7 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("I cannot login anymore", password => {
//cy.reload();
cy.get(".iziToast-wrapper")
.should("contain", "Incorrect email address or password.");
});
});

View File

@ -1,6 +1,6 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
When("I cannot submit the form", () => {
cy.get("button[type=submit]")
.should('be.disabled');
});
});

View File

@ -1,4 +1,4 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
When("I fill the password form with:", table => {
table = table.rowsHash();
@ -8,4 +8,4 @@ When("I fill the password form with:", table => {
.type(table["Your new password"])
.get("input[id=passwordConfirmation]")
.type(table["Confirm new password"]);
});
});

View File

@ -1,5 +1,5 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
When("I submit the form", () => {
cy.get("form").submit();
});
});

View File

@ -1,4 +1,4 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then('I can see my new name {string} when I click on my profile picture in the top right', name => {
cy.get(".avatar-menu").then(($menu) => {

View File

@ -1,4 +1,4 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
When('I have the following self-description:', text => {
cy.get('textarea[id=about]')
@ -9,4 +9,4 @@ When('I have the following self-description:', text => {
.not('[disabled]')
cy.get('.iziToast-message')
.should('contain', 'Your data was successfully updated')
})
})

View File

@ -1,4 +1,4 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
When('I save {string} as my location', location => {
cy.get('input[id=city]').type(location)
@ -10,4 +10,4 @@ When('I save {string} as my location', location => {
.not('[disabled]')
cy.get('.iziToast-message')
.should('contain', 'Your data was successfully updated')
})
})

View File

@ -1,4 +1,4 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
When('I save {string} as my new name', name => {
cy.get('input[id=name]')
@ -9,4 +9,4 @@ When('I save {string} as my new name', name => {
.not('[disabled]')
cy.get('.iziToast-message')
.should('contain', 'Your data was successfully updated')
})
})

View File

@ -1,5 +1,5 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
When('they can see the following text in the info box below my avatar:', text => {
cy.contains(text)
})
})

View File

@ -1,5 +1,5 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then('they can see {string} in the info box below my avatar', location => {
cy.contains(location)
})
})

View File

@ -1,4 +1,4 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
When('I add a social media link', () => {
cy.get('[data-test="add-save-button"]')
@ -7,4 +7,4 @@ When('I add a social media link', () => {
.type('https://freeradical.zone/peter-pan')
.get('[data-test="add-save-button"]')
.click()
})
})

View File

@ -1,8 +1,8 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then('I can cancel editing', () => {
cy.get('button#cancel')
.click()
.get('input#editSocialMedia')
.should('have.length', 0)
})
})

View File

@ -1,4 +1,4 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
When('I edit and save the link', () => {
cy.get('input#editSocialMedia')
@ -6,4 +6,4 @@ When('I edit and save the link', () => {
.type('https://freeradical.zone/tinkerbell')
.get('[data-test="add-save-button"]')
.click()
})
})

View File

@ -1,6 +1,6 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
When('I start editing a social media link', () => {
cy.get('[data-test="edit-button"]')
.click()
})
})

View File

@ -1,6 +1,6 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then('the new social media link shows up on the page', () => {
cy.get('a[href="https://freeradical.zone/peter-pan"]')
.should('have.length', 1)
})
})

View File

@ -1,6 +1,6 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then('the new url is displayed', () => {
cy.get("a[href='https://freeradical.zone/tinkerbell']")
.should('have.length', 1)
})
})

View File

@ -1,7 +1,7 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then('the old url is not displayed', () => {
cy.get("a[href='https://freeradical.zone/peter-pan']")
.should('have.length', 0)
})

View File

@ -1,8 +1,8 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then('they should be able to see my social media links', () => {
cy.get('[data-test="social-media-list-headline"]')
.contains('Peter Pan')
.get('a[href="https://freeradical.zone/peter-pan"]')
.should('have.length', 1)
})
})

View File

@ -1,5 +1,5 @@
import { Given } from "cypress-cucumber-preprocessor/steps";
import encode from '../../../backend/src/jwt/encode'
import { Given } from "@badeball/cypress-cucumber-preprocessor";
import encode from '../../../../backend/src/jwt/encode'
Given("I am logged in as {string}", slug => {
cy.neode()
@ -15,4 +15,4 @@ Given("I am logged in as {string}", slug => {
.then(user => {
cy.setCookie('ocelot-social-token', encode(user))
})
});
});

View File

@ -1,6 +1,6 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then("I am on page {string}", page => {
cy.location("pathname")
.should("match", new RegExp(page));
});
});

View File

@ -1,4 +1,4 @@
import { Then } from "cypress-cucumber-preprocessor/steps";
import { Then } from "@badeball/cypress-cucumber-preprocessor";
Then('I can see the following table:', table => {
const headers = table.raw()[0]
@ -13,4 +13,4 @@ Then('I can see the following table:', table => {
.eq(i)
.should('contain', expected)
})
})
})

View File

@ -1,4 +1,4 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
When("I choose the following text as content:", async text => {
cy.task('getValue', 'lastPost').then(lastPost => {
@ -6,4 +6,4 @@ When("I choose the following text as content:", async text => {
cy.task('pushValue', { name: 'lastPost', value: lastPost })
cy.get(".editor .ProseMirror").type(lastPost.content);
})
});
});

View File

@ -1,5 +1,4 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import 'cypress-network-idle';
import { When } from "@badeball/cypress-cucumber-preprocessor";
When("I click on {string}", element => {
const elementSelectors = {
@ -17,4 +16,4 @@ When("I click on {string}", element => {
cy.get(elementSelectors[element])
.click()
.wait(750);
});
});

View File

@ -1,4 +1,4 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
When("I click on {string} from the content menu in the user info box",
button => {
@ -9,4 +9,4 @@ When("I click on {string} from the content menu in the user info box",
force: true
});
}
);
);

View File

@ -1,4 +1,4 @@
import { When } from "cypress-cucumber-preprocessor/steps";
import { When } from "@badeball/cypress-cucumber-preprocessor";
When("I fill in my credentials {string} {string}", (email,password) => {
cy.get("input[name=email]")
@ -9,4 +9,4 @@ When("I fill in my credentials {string} {string}", (email,password) => {
.trigger("focus")
.type('{selectall}{backspace}')
.type(password);
});
});

Some files were not shown because too many files have changed in this diff Show More