mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
20 lines
614 B
JavaScript
20 lines
614 B
JavaScript
import { When } from "@badeball/cypress-cucumber-preprocessor";
|
|
|
|
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:first-child',
|
|
'comment button': 'button[type=submit]',
|
|
'reply button': '.reply-button',
|
|
'security menu': 'a[href="/settings/security"]',
|
|
'pin post': '.ds-menu-item:first-child',
|
|
'Moderation': 'a[href="/moderation"]',
|
|
}
|
|
|
|
cy.get(elementSelectors[element])
|
|
.click()
|
|
.wait(750);
|
|
});
|