Skip to content

Commit

Permalink
Cypress test for register component
Browse files Browse the repository at this point in the history
  • Loading branch information
Tishasoumya-02 committed Aug 20, 2024
1 parent fdcc874 commit 0ac6c45
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions packages/volto/cypress/tests/core/basic/register.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
describe('Register new user', () => {
beforeEach(() => {
cy.autologin();
cy.visit('/');
});
it('Register a new user', function () {
const api_url = 'http://127.0.0.1:55001/plone';

cy.visit('/register');
cy.get('#field-fullname').type('plone-dev');
cy.get('#field-email').type('[email protected]');
cy.get('button[title="Register"]').click();
cy.request({
method: 'POST',
url: `${api_url}/@users`,
headers: { Accept: 'application/json' },
body: {
username: 'plone-dev',
fullname: 'plone-dev',
email: '[email protected]',
password: 'password',
},
}).then((response) => {
expect(response.status).to.eq(201);
});
});
});

0 comments on commit 0ac6c45

Please sign in to comment.