You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The consumerUrl and providerUrl do not conform to the syntax of a generic URI. According to the generic syntax the scheme name is followed by a colon (:). This is missing in both of these two URLs, as there is no following colon (:) after http.
This configuration file cypress.config.ts, also defines a baseUrl. This baseUrl is used as prefix for every cy.visit() command's URL. If we want to visit a different host than the baseUrl, then we have to provide a fully qualified URL of the path we want to visit.
Although both of these tests pass, it is not testing what we wanted to. For example, in the second test, we intend to visit the providerUrl:http//localhost:28080, but the test redirects it to the baseUrl:http//localhost:18080 which is basically the consumerUrl. And ends up executing the rest of the tests on consumer data-dashboard.
it('should create an asset and view it on provider side',function(){cy.visit(providerUrl);
....});
After the redirect occurs, the dashboard can not load the introduction page. However, it can load the menu bar and therefore the second test also pass.
Bug Report
Describe the Bug
In spec.cy.js file the cypress tests aims to visit two URLs -
consumerUrl
andproviderUrl
. These two URLs are configured in cypress.config.ts file as,The
consumerUrl
andproviderUrl
do not conform to the syntax of a generic URI. According to the generic syntax the scheme name is followed by a colon (:
). This is missing in both of these two URLs, as there is no following colon (:
) afterhttp
.This configuration file cypress.config.ts, also defines a
baseUrl
. ThisbaseUrl
is used as prefix for everycy.visit()
command's URL. If we want to visit a different host than the baseUrl, then we have to provide a fully qualified URL of the path we want to visit.As the two URLs -
consumerUrl
andproviderUrl
, divert from the generic syntax, cypress can not recognize them as fully qualified URLs. Therefore, at the time of execution it appends these two URLs with the baseUrl, and ends up visiting the paths: http://localhost:18080/http//localhost:18080 and http://localhost:18080/http//localhost:28080Expected Behavior
The
cy.visit(consumerUrl)
andcy.visit(providerUrl)
commands should visit the URLs 'http://localhost:18080' and 'http://localhost:28080' correspondingly.Observed Behavior
cy.visit(consumerUrl)
andcy.visit(providerUrl)
commands try to visit the paths: http://localhost:18080/http//localhost:18080 and http://localhost:18080/http//localhost:28080 correspondingly. Although these paths do not exist, cypress redirects them to the host path(the baseUrl), and thus thecy.visit()
tests pass.Although both of these tests pass, it is not testing what we wanted to. For example, in the second test, we intend to visit the
providerUrl:http//localhost:28080
, but the test redirects it to thebaseUrl:http//localhost:18080
which is basically theconsumerUrl
. And ends up executing the rest of the tests on consumer data-dashboard.After the redirect occurs, the dashboard can not load the
introduction
page. However, it can load the menu bar and therefore the second test also pass.Steps to Reproduce
Steps to reproduce the behavior:
clone the DataDashboard project from https://github.com/eclipse-edc/DataDashboard/tree/main
from the root folder, run
npm install
run
docker compose up
. This will make consumer data-dashboard available at http://localhost:18080 and provider data-dashboard available at http://localhost:28080run
npx cypress open
to open the cypress test runner. (We assume that cypress is already installed)On test runner, click on
'E2E Testing' -> 'Start E2E Testing in Electron' -> 'spec.cy.js'
See that at the beginning of the test execution the navigation bar conatins the URL http://localhost:18080/http//localhost:18080 when running
cy.visit(consumerUrl)
and then http://localhost:18080/http//localhost:28080 when runningcy.visit(providerUrl)
.Both of them are then redirected to http://localhost:18080
Right click on the dashboard and select
Inspect Element
. In theNetwork
tab see theRequested URL
.In the
Console
tab, see theError: NG04002:... noMatchError
. This is thrown when it can not match any routes.Context Information
Possible Implementation
Update the consumer and provider URLs in cypress.config.ts file with right syntax, and adjust any changes in the spec.cy.js file.
The text was updated successfully, but these errors were encountered: