Closed jstawow closed 5 months ago
Hi @jstawow
Thank you for your interest in writing tests for OrangeHRM 5.5!
You will not be able to log in directly. If you look at the relevant code in our cypress test, you can see that we have a separate plugin that we use for testing: https://github.com/orangehrm/orangehrm/blob/main/src/test/functional/cypress/support/commands.js#L38-L47
This plugin is located in src/test/functional/tools/plugins/orangehrmFunctionalTestingPlugin
.
In order to setup for testing:
prepare.php
(src/test/functional/tools/prepare.php
)This will copy the plugin to src/plugins
and create a savepoint for the database. You can verify that it's working by running the cypress tests (README: https://github.com/orangehrm/orangehrm/blob/main/src/test/functional/Readme.md)
OrangeHRM version
5.5
Environment details
Describe the bug
I wrote such apiLogin test in playwright: It seems that I wrote all the same as in your cypress tests Why response that I got is html Why there is an error which I put down in bold What and how should I get from that response cookies or token in order to pass to another request When I use those credentials in website then I am logged in successfully to the orangehrm application on localhost test.only('Api login', async ({ request }) => {
}); output is as follow: Running 1 test using 1 worker [desktop-chromium] › functional/tests/pimPage.spec.ts:212:8 › Admin user should be able to manage on pim page › Api login <!DOCTYPE html>
To reproduce
No response
Expected behavior
No response
Relevant log output
No response