
* run critical tests after test env deployment * add cache * add all branches * change workflow name * add run on pull request for testing * change type * add run on deployment * run on copleted * test critical * add quote * change baseUrl * fix base url * fix base url * upload reports * run in parallel * save build folder * remove build from gitignore * remove build * update nide version * last try with parallel * save build * save build * Run critical * change cypress API url * run critical in parallel * check which workflow has lower duration time * save all reports with container in name * add reports on failure * remove reporters * fix jobs * merge * add group name * run critical * Refactor critical tests (#1906) * refactored tag added to purchaseWithProductsTypes, navigation, stocksInCheckout * homePageAnalitics - refactor * refactor home page * refactor creating variants * refactor adding product without sku to order * add script to run critical locally * change tests cases names * fix names, remove comments, add script to run refactored tests * remove workflow for parallel * remove key
56 lines
2 KiB
JavaScript
56 lines
2 KiB
JavaScript
/// <reference types="cypress"/>
|
|
/// <reference types="../support"/>
|
|
|
|
import { PERMISSIONS_OPTIONS } from "../fixtures/permissionsUsers";
|
|
import filterTests from "../support/filterTests";
|
|
import * as permissionsSteps from "../support/pages/permissionsPage";
|
|
|
|
describe("As a staff user I want to navigate through shop using different permissions", () => {
|
|
Object.keys(PERMISSIONS_OPTIONS).forEach(key => {
|
|
const tags =
|
|
key === "all" ? ["critical", "all", "refactored"] : ["all", "refactored"];
|
|
filterTests({ definedTags: tags }, () => {
|
|
it(`should be able to navigate through shop as a staff member using ${key} permission. ${PERMISSIONS_OPTIONS[key].testCase}`, () => {
|
|
const permissionOption = PERMISSIONS_OPTIONS[key];
|
|
const permissions = permissionOption.permissions;
|
|
cy.clearSessionData();
|
|
permissionsSteps.navigateToAllAvailablePageAndCheckIfDisplayed(
|
|
permissionOption
|
|
);
|
|
if (key === "all") {
|
|
return;
|
|
}
|
|
permissionsSteps
|
|
.getDisplayedSelectors()
|
|
.then(selectors => {
|
|
permissionsSteps.expectAllSelectorsPermitted(
|
|
permissions,
|
|
selectors
|
|
);
|
|
})
|
|
.then(() => {
|
|
if (!permissions) {
|
|
return;
|
|
}
|
|
permissions.forEach(permission => {
|
|
if (permission.parent) {
|
|
cy.get(permission.parent.parentMenuSelector)
|
|
.click()
|
|
.then(() => {
|
|
permissionsSteps.getDisplayedSelectors(
|
|
permission.parent.parentSelectors
|
|
);
|
|
})
|
|
.then(parentSelectors => {
|
|
permissionsSteps.expectAllSelectorsPermitted(
|
|
permissions,
|
|
parentSelectors
|
|
);
|
|
});
|
|
}
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|