Skip to content

Commit

Permalink
feat: move loadSampleData to before
Browse files Browse the repository at this point in the history
Signed-off-by: Kajetan Nobel <k.nobel@routegroup.pl>
  • Loading branch information
kajetan-nobel committed Jul 27, 2023
1 parent 6291205 commit fced5cb
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ const TEST_CONFIG = {
if (Cypress.env('SECURITY_ENABLED')) {
describe('Read Only mode', () => {
before(() => {
CURRENT_TENANT.newTenant = TEST_CONFIG.tenant.name;

cy.server();

cy.createTenant(TEST_CONFIG.tenant.name, {
Expand All @@ -47,16 +49,11 @@ if (Cypress.env('SECURITY_ENABLED')) {
cy.createRoleMapping(TEST_CONFIG.role.name, {
users: [TEST_CONFIG.user.username],
});
});

it('should create sample data', () => {
CURRENT_TENANT.newTenant = TEST_CONFIG.tenant.name;
cy.loadSampleData('flights');
cy.loadSampleData('logs');
});

it('should be able to modify the dashboard as admin', () => {
CURRENT_TENANT.newTenant = TEST_CONFIG.tenant.name;

cy.visit(BASE_PATH);
cy.waitForLoader();

Expand All @@ -74,7 +71,6 @@ if (Cypress.env('SECURITY_ENABLED')) {
it('should not be able to modify the dashboard when is performing as a custom readonly tenant', () => {
ADMIN_AUTH.newUser = TEST_CONFIG.user.username;
ADMIN_AUTH.newPassword = TEST_CONFIG.user.password;
CURRENT_TENANT.newTenant = TEST_CONFIG.tenant.name;

cy.visit(BASE_PATH);
cy.waitForLoader();
Expand Down

0 comments on commit fced5cb

Please sign in to comment.