Skip to content

Commit

Permalink
Merge pull request #49 from Abstract-Tech/feature/vertical-nav
Browse files Browse the repository at this point in the history
added authn test
  • Loading branch information
DJkal11 committed Oct 13, 2023
2 parents 705ce5b + 09880ce commit 63832da
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
@@ -0,0 +1,40 @@
describe("Register user test", () => {
beforeEach(() => {


cy.visit(`${Cypress.env("LMS_URL")}`);

cy.on("uncaught:exception", (err) => {
if (err.message.includes("ResizeObserver loop limit exceeded")) {
// This error is expected, so suppress it and continue the test
return false;
}
});


cy.on('uncaught:exception', (e) => {
if (e.message.includes('Things went bad')) {
// We expected this error, so let's ignore it and let the test continue
return false;
}
});


cy.get("body");
cy.get(".global-header .nav-links .secondary a.register-btn").click({ force: true });


});

it("test the registration page", function() {
cy.get('#name').type('test_name');
cy.get('#email').type('123@gmail.com');
cy.get('#username').type('test_username', { force: true } );
cy.get('#password').type('test_password12');
cy.get("#country").type('Italy');
cy.get('.dropdown-container button[name="countryItem"][value="Italy"]').click({ force: true });

cy.get("#register-user").click({ force: true });
});
});

11 changes: 10 additions & 1 deletion env/build/openedx/e2e/cypress/support/commands.js
Expand Up @@ -22,4 +22,13 @@
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })

Cypress.Commands.add("handleResizeObserverError", () => {
cy.on("uncaught:exception", (err) => {
if (err.message.includes("ResizeObserver loop limit exceeded")) {
cy.log("ResizeObserver loop limit exceeded error occurred but was suppressed.");
return false;
}
});
});

0 comments on commit 63832da

Please sign in to comment.