Skip to content

Commit 9584b22

Browse files
authored
fix(high-level-tests): issue HTTP requests to the fronts and never to the API directly
because otherwise it looses the front URL and prevent URL-based security mechanisms to apply.
1 parent a35dfc3 commit 9584b22

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

high-level-tests/e2e/cypress.config.cjs

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ async function setupNodeEvents(on, config) {
5656
module.exports = defineConfig({
5757
env: {
5858
APP_URL: "http://localhost:4200",
59-
API_URL: "http://localhost:3000",
6059
ORGA_URL: "http://localhost:4201",
6160
visualRegressionType: "regression",
6261
},

high-level-tests/e2e/cypress/support/commands.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function setEmberSimpleAuthSession(response) {
3131
Cypress.Commands.add("login", (username, password, url) => {
3232
cy.intercept("/api/users/me").as("getCurrentUser");
3333
cy.request({
34-
url: `${Cypress.env('API_URL')}/api/token`,
34+
url: `${Cypress.env('APP_URL')}/api/token`,
3535
method: 'POST',
3636
form: true,
3737
body: getLoginBody(username, password, 'mon-pix'),
@@ -44,7 +44,7 @@ Cypress.Commands.add("login", (username, password, url) => {
4444
Cypress.Commands.add('loginOrga', (username, password) => {
4545
cy.intercept('/api/prescription/prescribers/**').as('getCurrentUser');
4646
cy.request({
47-
url: `${Cypress.env('API_URL')}/api/token`,
47+
url: `${Cypress.env('ORGA_URL')}/api/token`,
4848
method: 'POST',
4949
form: true,
5050
body: getLoginBody(username, password, 'pix-orga'),

0 commit comments

Comments
 (0)