Ocelot-Social/cypress/integration/common/I_click_on_{string}.js
Ulf Gebhardt a02a72de82
unified click events
separated post in post.create & post
2021-04-12 13:24:51 +02:00

14 lines
387 B
JavaScript

import { When } from "cypress-cucumber-preprocessor/steps";
When("I click on {string}", element => {
const elementSelectors = {
'submit button': 'button[name=submit]',
'create post button': '.post-add-button',
'save button': 'button[type=submit]',
'the first post': '.post-teaser:nth-child(1)',
}
cy.get(elementSelectors[element])
.click()
.wait(750);
});