Fix oauth cypress test

This commit is contained in:
jc21 2024-11-13 13:38:33 +10:00
parent a856c4d6e1
commit f4bd65dd2c
2 changed files with 34 additions and 10 deletions

View File

@ -50,18 +50,42 @@ describe('OAuth with Authentik', () => {
it('Should log in with OAuth', function() { it('Should log in with OAuth', function() {
cy.task('backendApiGet', { cy.task('backendApiGet', {
token: token, path: '/oauth/login?redirect_base=' + encodeURI(Cypress.config('baseUrl')),
path: '/oauth/login?redirect_base=' + encodeURI('http://fullstack:81'),
}).then((data) => { }).then((data) => {
expect(data).to.have.property('result'); expect(data).to.have.property('result');
cy.visit(data.result); cy.visit(data.result);
cy.get('input[name="uidField"]').type('cypress');
cy.get('button[type="submit"]').click(); cy.get('ak-flow-executor')
cy.get('input[name="password"]').type('fqXBfUYqHvYqiwBHWW7f'); .shadow()
cy.get('button[type="submit"]').click(); .find('ak-stage-identification')
// confirmation page .shadow()
cy.get('button[type="submit"]').click(); .find('input[name="uidField"]', { visible: true })
cy.url().should('match', /fullstack/) .type('cypress');
cy.get('ak-flow-executor')
.shadow()
.find('ak-stage-identification')
.shadow()
.find('button[type="submit"]', { visible: true })
.click();
cy.get('ak-flow-executor')
.shadow()
.find('ak-stage-password')
.shadow()
.find('input[name="password"]', { visible: true })
.type('fqXBfUYqHvYqiwBHWW7f');
cy.get('ak-flow-executor')
.shadow()
.find('ak-stage-password')
.shadow()
.find('button[type="submit"]', { visible: true })
.click();
cy.get('#root p.chakra-text')
.first()
.should('have.text', 'Nginx Proxy Manager');
}); });
}); });
} }

View File

@ -1,5 +1,5 @@
{ {
"name": "test", "name": "npmtestsuite",
"version": "1.0.0", "version": "1.0.0",
"description": "", "description": "",
"main": "index.js", "main": "index.js",