-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
70 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { When, Then, Given } from "@badeball/cypress-cucumber-preprocessor"; | ||
|
||
Given("I am on login page", () => { | ||
cy.visit("/"); | ||
}); | ||
|
||
Given( | ||
"an administrator account named {word} exists", | ||
(admin_account_exists) => { | ||
console.log("Admin exists, SUCCESS"); | ||
// TODO: implement | ||
} | ||
); | ||
|
||
Given("I am logged in as {word}", (loginName) => { | ||
|
||
}); | ||
|
||
When("I logout", () => {}); | ||
|
||
When("I open the side menu", () => { | ||
cy.get('[id="nav-toggle"]').then(($ele => { | ||
if ($ele.attr('aria-expanded') === 'false') { | ||
$ele.click(); | ||
} | ||
})) | ||
}) | ||
|
||
When("I close the side menu", () => { | ||
cy.get('[id="nav-toggle"]').then(($ele => { | ||
if ($ele.attr('aria-expanded') === 'true') { | ||
$ele.click(); | ||
} | ||
})) | ||
}) | ||
When("I click on {} tab", (tabText) => { | ||
cy.get('nav a').contains(tabText).click(); | ||
}); | ||
|
||
When("I click on {} button", function (buttonText) { | ||
cy.get('button').contains(buttonText).click(); | ||
}); | ||
|
||
When("in a dialog I click on {} button", function (buttonText) { | ||
cy.get('[role=dialog] button').contains(buttonText).click(); | ||
}); | ||
|
||
When("I type in the field {} text {}", (fieldName, content) => { | ||
cy.get('[role=dialog] label').contains(fieldName).parent().then(($label) => | ||
{ | ||
cy.get('[name=modal-form-' + $label.attr('for') + ']').type(content); | ||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Created by mpolovka at 25/07/2023 | ||
Feature: Test the test | ||
Yolo, do not commit | ||
Scenario: idk lol | ||
When I am on login page | ||
When I open the side menu | ||
When I click on Active users tab | ||
When I close the side menu | ||
When I open the side menu | ||
When I click on Stage users tab | ||
When I close the side menu | ||
When I click on Add button | ||
When I type in the field User login text testuser1 | ||
When I type in the field First name text Test | ||
When I type in the field Last name text User | ||
When in a dialog I click on Add button | ||
|