Skip to content

Commit

Permalink
Upgrades PT6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
karesti committed Jan 20, 2025
1 parent 4e59c59 commit 834064f
Show file tree
Hide file tree
Showing 7 changed files with 1,798 additions and 1,396 deletions.
22 changes: 13 additions & 9 deletions cypress/e2e/3_proto-schema.cy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
describe('Proto Schema CRUD', () => {
const schemaName = 'aTestSchema';
beforeEach(() => {
// Make sure aTestSchema schema does not exist
cy.cleanupTest(Cypress.env('username'), Cypress.env('password'),
'/schemas/' + schemaName + '.proto');
cy.wait(1000);
cy.login(Cypress.env('username'), Cypress.env('password'));
});

Expand Down Expand Up @@ -50,11 +55,11 @@ describe('Proto Schema CRUD', () => {
});

it('successfully creates, edits and deletes a proto schema', () => {
cy.wait(2000); // wait for the delete to be done
clickTabSchemas();

//Creating new schema
cy.get('button[aria-label="create-schema-button"]').click();
const schemaName = 'aTestSchema';
cy.get('#schema-name').click().type(schemaName);
cy.get('#schema').click().type('schemaValue');
cy.get('[data-cy="addSchemaButton"]').click();
Expand All @@ -69,23 +74,22 @@ describe('Proto Schema CRUD', () => {
cy.contains('schemaValue');
cy.contains('Save');
//Artificially adding here some delays between actions so that the proto schema is updated properly and normally shown on the page.
cy.wait(3000);
cy.get('[data-cy=schemaEditArea]').type('{selectall}', { timeout: 10000 });
cy.wait(3000);
cy.wait(1000);
cy.get('[data-cy=schemaEditArea]').type('{selectall}', { timeout: 5000 });
cy.wait(1000);
cy.get('[data-cy=schemaEditArea]').type(
'package org.infinispan; message ExampleProto { optional int32 other_id = 1; }',
{ parseSpecialCharSequences: false }
);
cy.wait(3000);
cy.wait(1000);º
cy.get('button[aria-label="confirm-edit-schema-button"]').click();
cy.wait(3000);
cy.contains('Schema ' + schemaName +'.proto updated.');
cy.wait(3000);
cy.wait(1000);
cy.get('[name=close-alert-button]').click(); //Closing alert popup.
//Waiting 5 seconds so that the proto schema is managed to be updated on the page.
cy.wait(3000);
cy.wait(1000);
cy.get('[data-cy="' + schemaName + '.protoConfig"]').click();
cy.wait(3000);
cy.wait(1000);
cy.contains('schemaValue').should('not.exist');
cy.contains('ExampleProto');
cy.contains('Schema ' + schemaName + '.proto has errors').should('not.exist');
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ module.exports = {
transformIgnorePatterns: ['/node_modules/(?!(react-syntax-highlighter)/)'],

// The test environment that will be used for testing.
testEnvironment: "jsdom",
testEnvironment: "jest-fixed-jsdom",
};
Loading

0 comments on commit 834064f

Please sign in to comment.