Skip to content

Commit 4e6d656

Browse files
committed
Fix cypress oauth test one more time
1 parent 8434b9f commit 4e6d656

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

test/cypress/e2e/api/OAuth.cy.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@ describe('OAuth with Authentik', () => {
5353
path: '/oauth/login?redirect_base=' + encodeURI(Cypress.config('baseUrl')),
5454
}).then((data) => {
5555
expect(data).to.have.property('result');
56-
cy.visit(data.result);
5756

58-
cy.get('ak-flow-executor')
57+
cy.origin('http://authentik:9000', {args: data.result}, (url) => {
58+
cy.visit(url);
59+
cy.get('ak-flow-executor')
5960
.shadow()
6061
.find('ak-stage-identification')
6162
.shadow()
@@ -82,10 +83,15 @@ describe('OAuth with Authentik', () => {
8283
.shadow()
8384
.find('button[type="submit"]', { visible: true })
8485
.click();
86+
})
8587

88+
// we should be logged in
8689
cy.get('#root p.chakra-text')
8790
.first()
8891
.should('have.text', 'Nginx Proxy Manager');
92+
93+
// logout:
94+
cy.clearLocalStorage();
8995
});
9096
});
9197
}

test/cypress/e2e/ui/SetupLogin.cy.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ describe('UI Setup and Login', () => {
1414
cy.get('input[name="password"]').type('changeme');
1515
cy.get('form button:last').click();
1616

17-
// To fix after chakra change:
18-
// cy.get('.navbar-nav .avatar').should('be.visible');
17+
cy.get('#root p.chakra-text')
18+
.first()
19+
.should('have.text', 'Nginx Proxy Manager');
1920

2021
// logout:
2122
cy.clearLocalStorage();

0 commit comments

Comments
 (0)