-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UI e2e testing framework #7350
UI e2e testing framework #7350
Conversation
7ff0f5c
to
292a7d9
Compare
d32384e
to
d6b3303
Compare
Difference between
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some modifications/answers on my sides
@echo "make test-x11: run tests interactively (w/ X11 \$$DISPLAY)" | ||
@echo "" | ||
@echo "make [target] DEBUG=cypress:* (see https://docs.cypress.io/guides/references/troubleshooting#Log-sources)" | ||
@echo "make [target] BROWSER=firefox:nightly" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@echo "make [target] BROWSER=firefox:nightly" | |
@echo "make [target] BROWSER= chrome" # or for ex: firefox:nightly |
To be consistant with default values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default was changed, firefox is preferred due to lower memory usage. It also gives us better coverage that will prevent firefox-only issues in the future.
'cypress/specs/e2e/*-configurator/**/*.cy.{js,jsx,ts,tsx}', | ||
], | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as the other one => t/html/pfappserver/cypress/config/cypress.config-configuration.js
Duplicate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a stub for differentiation so it's more explicit for the next person to setup a new scenario using the same framework.
module.exports = { | ||
// defaultCommandTimeout: 10000, // 10s | ||
e2e: { | ||
baseUrl: 'https://localhost:1443', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it supposed to be variables? or there is an override system
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cypress uses NodeJS, so this is what's expected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I misunderstood which line you were referring to. I understand now.
This is the default value. Our vars are injected in the scenario through make using the BASE_URL
environmental value.
/* | ||
cy.visit('https://localhost:1443/admin#/login').then(() => { | ||
cy.readFile('/usr/local/pf/conf/unified_api_system_pass').then((password) => { | ||
cy.get('form input#username').first().type('system') | ||
cy.get('form input#password').first().type(password) | ||
cy.get('form button[type="submit"]').first().click() | ||
}) | ||
}) | ||
*/ | ||
return cy.pfUnifiedSystemPassword().then(password => { | ||
return cy.request('POST', '/api/v1/login', { username: 'system', password }).then(response => { | ||
return window.localStorage.setItem('user-token', response.body.token) | ||
}) | ||
}) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we using API or the browser?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The configurator is using the Browser, which doesn't require /login
This was created during the PoC to provide a support helper for writing tests. I left it there to help with future development.
I resolved some conversation.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move t/venom/scenarios/pfappserver/README.md to t/venom/test_suites/pfappserver_configurator/TESTSUITE.md to be consistant with the other tests.
t/venom/scenarios is more for ansible to prepare the environment and the test and it can be shared with multiple test_suites.
@nqb repo rebased w/ devel. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, looks good to me.
Running a pipeline to see if artifacts are saved correctly: https://gitlab.com/inverse-inc/packetfence/-/pipelines/891933439 |
Regarding Difference between |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@satkunas, I identified few issues:
- We need to configure 2nd interface (eth1) as management during configurator and not 1st interface (eth0). Otherwise, it can cause issues because iptables will reject SSH requests on eth1
- Artifacts were not correctly pulled using Ansible because hostname is changed during configurator. This issue should be fixed now
- I'm not able to see if screenshots are available in GitLab because it looks like current Cypress test doesn't generate screenshots, could you tell me how I can enable this ?
- There is a firefox error when we run tests on Debian (I provided logs in DM)
Also I opened #7704 because I got it while testing.
Adjustments have been made
This is automatic. By default at least 1 screenshot should be created w/ a failed test. This is where I mentioned I had some trouble extracting the them from the VM.
I added a If the test still fails, we may need to revert back to using the default browser.
|
Running a new pipeline to see if it's better: https://gitlab.com/inverse-inc/packetfence/-/pipelines/893321590 |
Description
Integrate cypress end-to-end testing framework
Impacts
Venom workflows
CI/CD results
NEW Package(s) required
RHEL
Debian
Delete branch after merge
YES
Checklist
(REQUIRED) - [yes, no or n/a]
NEWS file entries
(REQUIRED, but may be optional...)
New Features