Description
Current behavior:
When I instruct cypress to login to an Oracle APEX application, the authentication re-directs cypress to a '404 not found' page because the authenticated URL is malformed. The malformed URL is the only issue and can simply corrected programmatically (with a find and replace command).
However - it is very important to note that the cypress login correctly returns:
- a valid cookie
- a valid session
which is everything you need for authentication.
Desired behavior:
Cypress, ideally, should be able to follow the same authentication redirect that a user would in a regular browser.
Steps to reproduce: (app code and test code)
I created a dummy application with dummy credentials hosted by apex.oracle.com to demonstrate:
it('Login demo', function() {
cy.visit('https://apex.oracle.com/pls/apex/f?p=54707:LOGIN_DESKTOP')
cy.get('#P9999_USERNAME').type('ApexUser')
cy.get('#P9999_PASSWORD').type('Oradoc_db1')
cy.get('.t-Button').click()
})
The above code (which should work until the application expires in many months) will redirect to a 404 not found page with a url in the format:
https://apex.oracle.com/__/f?p=54707:1:[session_id]:::::
Outside of cypress the url will have the format:
https://apex.oracle.com/pls/apex/f?p=54707:1:[session_id]:::::
Versions
I have tested this across 4 instances of Oracle APEX (APEX 5.0, 5.1, 18.1 and 19) and this behavior is consistent.