-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
feat(webdriverio): Add webdriverio end to end test framework. #11016
base: master
Are you sure you want to change the base?
Conversation
1129e3f
to
1e0a73e
Compare
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.
Very good start Tudor! 🚀 I left some comments after an initial pass.
package.json
Outdated
"@wdio/allure-reporter": "7.16.14", | ||
"@wdio/cli": "7.16.15", | ||
"@wdio/junit-reporter": "7.16.15", | ||
"@wdio/local-runner": "^7.16.13", |
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.
Make sure we used specific versions, no ^
package.json
Outdated
@@ -179,6 +189,7 @@ | |||
"lint-fix": "eslint --max-warnings 0 --fix .", | |||
"postinstall": "patch-package && jetify", | |||
"validate": "npm ls", | |||
"start": "make dev" | |||
"start": "make dev", | |||
"wdio": "wdio run wdio.conf.js" |
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.
Let's call this e2e-tests
|
||
## Steps to generate allure reports: | ||
* Check if the <i>allure-results</i> was generated | ||
* In order to generate the <i>allure-reports</i>, run the following command: allure generate allure-results/ && allure open |
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.
Add a script in package.json to do this please. Maybe some e2ee-test-reports
test/helpers/constants.js
Outdated
@@ -0,0 +1 @@ | |||
export const BASE_URL = 'https://localhost:8080'; |
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.
This needs to be configurable, from an environment variable, with a sane default.
test/helpers/lobbyHelper.js
Outdated
@@ -0,0 +1,37 @@ | |||
export default async function openSession(participant) { |
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.
Docs!
wdio.conf.js
Outdated
// Define all options that are relevant for the WebdriverIO instance here | ||
// | ||
// Level of logging verbosity: trace | debug | info | warn | error | silent | ||
logLevel: 'info', |
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.
Don't we want more?
wdio.conf.js
Outdated
// with `/`, the base url gets prepended, not including the path portion of your baseUrl. | ||
// If your `url` parameter starts without a scheme or `/` (like `some/path`), the base url | ||
// gets prepended directly. | ||
baseUrl: 'http://localhost', |
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.
We need to take this value from an env var.
baseUrl: 'http://localhost', | ||
// | ||
// Default timeout for all waitFor* commands. | ||
waitforTimeout: 10000, |
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.
IMHO every waitFor should be explicit, waiting for a long time everywhere sounds not so great.
wdio.conf.js
Outdated
// your test setup with almost no effort. Unlike plugins, they don't add new | ||
// commands. Instead, they hook themselves up into the test process. | ||
//services: ['chromedriver'], | ||
services: ['selenium-standalone'], |
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.
Is this where we could plug the grid?
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.
No. The configuration for the grid will look like this -> example:
// Remote selenium grid.
hostname: 'selenium-grid-link',
port: 4444,
path: '/wd/hub/',
protocol: 'http',
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.
But can you pass that as command-line arguments?
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.
Jenkins needs to set it somehow without changing the source code.
// | ||
// Make sure you have the wdio adapter package for the specific framework installed | ||
// before running any tests. | ||
framework: 'mocha', |
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 see there are other options. Any reason why you went with this one?
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 reason I chose this is because the wdio documentation and most of the existing examples focus on mocha and it is easier for me to follow what I need to do. I did not notice a major difference between the options we have available.
package.json
Outdated
"start": "make dev" | ||
"start": "make dev", | ||
"e2e-tests": "wdio run wdio.conf.js", | ||
"e2e-test-reports": "npx wdio run ./wdio.conf.js && allure generate allure-results/ --clean && allure open" |
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.
Let's make sure reports are always created, but don't try to open them because this will run on a CI 99% of the time.
test/helpers/firefoxSession.js
Outdated
@@ -0,0 +1,19 @@ | |||
import { remote } from 'webdriverio' | |||
export default async function createFirefoxSession() { | |||
const browser = await remote({ |
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.
No need to await here, you can just return.
test/helpers/openParticipantsPane.js
Outdated
const ParticipantsPane = require("../page-objects/ParticipantsPane"); | ||
const Toolbox = require("../page-objects/Toolbox") | ||
export default async function openParticipantsPane() { | ||
const toolbox = await Toolbox.ToolboxView; |
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.
This reads super weird because you are awaiting a property. Please call it something like getXXX
// Participants pane object. | ||
get ParticipantsPaneView() { | ||
const participantsPane = $('.participants_pane'); | ||
return participantsPane |
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.
Unneeded variable
|
||
// Participants pane object. | ||
get ParticipantsPaneView() { | ||
const participantsPane = $('.participants_pane'); |
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.
Please don't use jQuery, we want to kill it.
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.
test/specs/lobbyAdmitParticipant.js
Outdated
default: | ||
roomName = 'SafariRoomNameTest' | ||
} | ||
await browser.url(`${BASE_URL}/${roomName}?${DEFAULT_CONFIG}`); |
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.
Please space things out a bit, this is very hard to read.
test/specs/lobbyAdmitParticipant.js
Outdated
default: | ||
roomName = 'SafariRoomNameTest' | ||
} | ||
await browser.url(`${BASE_URL}/${roomName}?${DEFAULT_CONFIG}`); |
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.
This should probably be a helper.
test/specs/lobbyAdmitParticipant.js
Outdated
}); | ||
it('should open jitsi-meet with same room name where second participant wants to join', async () => { | ||
|
||
switch (capabilities.browserName) { |
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 decision of the type of browser to use must come from an env var.
test/specs/lobbyAdmitParticipant.js
Outdated
let capabilities; | ||
let Guest1; | ||
it('should open jitsi-meet app and enable lobby by first participant', async () => { | ||
capabilities = await browser.requestedCapabilities; |
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.
What is this?
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.
Removed. Just tested something related to browser capabilities.
test/specs/lobbyAdmitParticipant.js
Outdated
describe('Activate lobby and admit participant', () => { | ||
let roomName; | ||
let capabilities; | ||
let Guest1; |
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.
Please use the same terminology as we do in torture: Participant.
…e for max instances.
This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
No description provided.