-
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
Open
tudor-phd
wants to merge
43
commits into
jitsi:master
Choose a base branch
from
tudor-phd:webdriverio
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+9,950
−4,316
Open
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
9857ad9
feat(webdriverio-tests): Create setup for webdriverio.
4fa46c8
feat(webdriverio-tests): Create setup for webdriverio.
c45b50d
webdriverio wip
537df4f
feat(webdriverio): Add webdriverio end to end test framework.
7183f9a
feat(webdriverio): Add webdriverio end to end test framework.
aee5bea
feat(webdriverio): Add webdriverio end to end test framework.
07a3413
feat(webdriverio): Add webdriverio end to end test framework.
2c8067d
feat(webdriverio): Add webdriverio end to end test framework.
2bac41e
feat(webdriverio): Add webdriverio end to end test framework.
654431d
feat(webdriverio): Add webdriverio end to end test framework.
47d2494
feat(webdriverio): Add webdriverio end to end test framework.
56ba3a4
feat(webdriverio): Add webdriverio end to end test framework.
6bd9bab
feat(webdriverio): Add webdriverio end to end test framework.
5c15a4f
feat(webdriverio): Add webdriverio end to end test framework.
0398937
feat(webdriverio): Add webdriverio end to end test framework.
18baa8e
feat(webdriverio): Add webdriverio end to end test framework.
d9fb63c
feat(webdriverio): Add webdriverio end to end test framework.
c9ece1e
feat(webdriverio): Add webdriverio end to end test framework.
5888e73
feat(webdriverio): Add webdriverio end to end test framework.
05a17c4
feat(webdriverio): Add webdriverio end to end test framework.
a3171c5
feat(webdriverio): Add webdriverio end to end test framework.
f4e7790
feat(webdriverio): Add webdriverio end to end test framework.
676e94b
feat(webdriverio): Add webdriverio end to end test framework.
72eba04
feat(webdriverio): Add webdriverio end to end test framework.
28842ee
feat(webdriverio): Add webdriverio end to end test framework.
888e8a4
feat(webdriverio): Add webdriverio end to end test framework.
2e455cf
feat(webdriverio): Add webdriverio end to end test framework.
58dc9ea
feat(webdriverio): Add webdriverio end to end test framework.
dd14979
feat(webdriverio): Add ability to specify a browser for each particip…
8a40d06
feat(webdriverio): Add ability to specify a browser for each particip…
0f85eb5
feat(webdriverio): Remove the concept of moderator browser.
206c8d1
feat(webdriverio): Add grid configuration.
62b8692
feat(webdriverio): Change max instances value to 16.
c4d4843
feat(webdriverio): Add conditional services based on grid availability.
1ac319d
feat(webdriverio): Add some comments on defined constants.
f9b4066
feat(webdriverio): Remove .env file.
a747ac0
feat(webdriverio): Simplify grid url env variable and add env variabl…
34cff7e
feat(webdriverio): Add console logs as attachment to tests reports.
e14bb1b
feat(webdriverio): Make sure that grid port parameter is always a num…
e70f29d
feat(webdriverio): Fix typo on grid url.
e1e2776
feat(webdriverio): Fix typo on hostname parameter.
f10151e
feat(webdriverio): Get page objects for each specific browser.
41bacde
feat(webdriverio): Comment the beforeHook code block.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
.*.tmp | ||
deploy-local.sh | ||
libs/ | ||
allure-report/ | ||
allure-results/ | ||
all.css | ||
*css.map | ||
.remote-sync.json | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# WebdriverIO Test Automation Framework | ||
|
||
## Steps to run tests locally: | ||
* Run <strong>npm install</strong> command | ||
* Start de app locally with <i>make dev</i> command | ||
* Running all tests: <strong>npx wdio run ./wdio.conf.js</strong> | ||
* Running specific test: <strong>npx wdio run ./wdio.conf.js --spec testName.js</strong> | ||
* Running tests will generate the <i>allure-results</i> folder | ||
|
||
## 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 | ||
* If the allure-report has already been generated, there will be a conflict; in order to avoid this, the <strong>--clean</strong> flag needs to be used and the following command would be required: allure generate allure-results/ --clean && allure open |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { | ||
CHROME_BROWSER, | ||
CHROME_PROPERTIES, | ||
FIREFOX_PROPERTIES, | ||
PARTICIPANT1_BROWSER | ||
} from './constants'; | ||
|
||
/** | ||
* Function that creates browser capabilities. | ||
* | ||
* @returns {Object} | ||
*/ | ||
export default function createBrowserCapabilities() { | ||
|
||
if (PARTICIPANT1_BROWSER === CHROME_BROWSER) { | ||
return CHROME_PROPERTIES; | ||
} | ||
|
||
return FIREFOX_PROPERTIES; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* eslint-disable no-undef */ | ||
|
||
// Define base url. | ||
export const BASE_URL = process.env.BASE_URL || 'https://alpha.jitsi.net'; | ||
|
||
// Define available browsers. | ||
export const FIREFOX_BROWSER = 'firefox'; | ||
export const CHROME_BROWSER = 'chrome'; | ||
|
||
// Define browser for each participant. | ||
export const PARTICIPANT1_BROWSER = process.env.PARTICIPANT1_BROWSER || CHROME_BROWSER; | ||
export const PARTICIPANT2_BROWSER = process.env.PARTICIPANT2_BROWSER || CHROME_BROWSER; | ||
export const PARTICIPANT3_BROWSER = process.env.PARTICIPANT3_BROWSER || CHROME_BROWSER; | ||
|
||
// Define default config. | ||
export const DEFAULT_CONFIG | ||
= 'config.requireDisplayName=false' | ||
+ '&config.debug=true' | ||
+ '&config.testing.testMode=true' | ||
+ '&config.disableAEC=true' | ||
+ '&config.disableNS=true' | ||
+ '&config.enableTalkWhileMuted=false' | ||
+ '&config.callStatsID=false' | ||
+ '&config.alwaysVisibleToolbar=true' | ||
+ '&config.p2p.enabled=false' | ||
+ '&config.p2p.useStunTurn=false' | ||
+ '&config.pcStatsInterval=1500' | ||
+ '&config.prejoinConfig.enabled=false' | ||
+ '&config.gatherStats=true' | ||
+ '&config.disable1On1Mode=true' | ||
+ '&config.analytics.disabled=true' | ||
+ '&interfaceConfig.SHOW_CHROME_EXTENSION_BANNER=false' | ||
+ '&interfaceConfig.DISABLE_FOCUS_INDICATOR=true'; | ||
|
||
// Define participants names. | ||
export const FIRST_PARTICIPANT = 'First participant'; | ||
export const SECOND_PARTICIPANT = 'Second participant'; | ||
export const THIRD_PARTICIPANT = 'Third participant'; | ||
|
||
export const ENTER_KEY = '\uE007'; | ||
|
||
// Define chrome properties. | ||
export const CHROME_PROPERTIES = { | ||
maxInstances: 4, | ||
browserName: CHROME_BROWSER, | ||
acceptInsecureCerts: true, | ||
'goog:chromeOptions': { | ||
args: [ | ||
'use-fake-device-for-media-stream', | ||
'use-fake-ui-for-media-stream', | ||
'disable-plugins', | ||
'mute-audio', | ||
'disable-infobars', | ||
'autoplay-policy=no-user-gesture-required', | ||
'auto-select-desktop-capture-source=Your Entire screen' | ||
] | ||
} | ||
}; | ||
|
||
// Define firefox properties. | ||
export const FIREFOX_PROPERTIES = { | ||
maxInstances: 4, | ||
browserName: FIREFOX_BROWSER, | ||
acceptInsecureCerts: true, | ||
'moz:firefoxOptions': { | ||
'prefs': { | ||
'media.navigator.streams.fake': true, | ||
'media.navigator.permission.disabled': true, | ||
'media.peerconnection.ice.tcp': true, | ||
'intl.accept_languages': 'en', | ||
'media.autoplay.default': 0 | ||
} | ||
} | ||
}; | ||
|
||
// Define remote selenium grid url. | ||
export const GRID_URL = process.env.GRID_URL ? new URL(process.env.GRID_URL) : null; | ||
|
||
// Define services properties based on grid availability. | ||
export const SERVICES = GRID_URL ? [] : [ 'selenium-standalone' ]; | ||
|
||
// Define max instances. | ||
|
||
export const MAX_INSANCES = process.env.MAX_INSANCES || 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { | ||
PARTICIPANT1_BROWSER, | ||
PARTICIPANT2_BROWSER, | ||
PARTICIPANT3_BROWSER, | ||
FIRST_PARTICIPANT, | ||
SECOND_PARTICIPANT, | ||
THIRD_PARTICIPANT | ||
} from './constants'; | ||
import createSession from './createSession'; | ||
|
||
/** | ||
* Function that creates a browser session. | ||
* | ||
* @returns {void} | ||
*/ | ||
export default function createBrowserSession(participant) { | ||
switch (participant) { | ||
case FIRST_PARTICIPANT: | ||
return createSession(PARTICIPANT1_BROWSER); | ||
case SECOND_PARTICIPANT: | ||
return createSession(PARTICIPANT2_BROWSER); | ||
case THIRD_PARTICIPANT: | ||
return createSession(PARTICIPANT3_BROWSER); | ||
default: | ||
return; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* eslint-disable no-undef */ | ||
|
||
/** | ||
* Create meeting room function. | ||
* | ||
* @returns {void} | ||
*/ | ||
export default function createMeetingRoom(meetingUrl) { | ||
browser.url(meetingUrl); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { v4 as uuidv4 } from 'uuid'; | ||
|
||
import { BASE_URL, DEFAULT_CONFIG } from './constants'; | ||
|
||
/** | ||
* Function that creates a meeting url. | ||
* | ||
* @returns {void} | ||
*/ | ||
export default function createMeetingUrl() { | ||
// eslint-disable-next-line prefer-template | ||
return `${BASE_URL}/${'WdioMeeting-' + uuidv4()}?${DEFAULT_CONFIG}`; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { remote } from 'webdriverio'; | ||
|
||
import { | ||
CHROME_BROWSER, | ||
FIREFOX_BROWSER | ||
} from './constants'; | ||
|
||
/** | ||
* Function that creates a session. | ||
* | ||
* @returns {void} | ||
*/ | ||
export default function createSession(participantBrowser) { | ||
|
||
switch (participantBrowser) { | ||
case CHROME_BROWSER: | ||
return remote({ | ||
path: '/wd/hub', | ||
capabilities: { | ||
browserName: CHROME_BROWSER, | ||
acceptInsecureCerts: true, | ||
'goog:chromeOptions': { | ||
args: [ | ||
'use-fake-device-for-media-stream', | ||
'use-fake-ui-for-media-stream', | ||
'disable-plugins', | ||
'mute-audio', | ||
'disable-infobars', | ||
'autoplay-policy=no-user-gesture-required', | ||
'auto-select-desktop-capture-source=Your Entire screen' | ||
] | ||
} | ||
} | ||
}); | ||
case FIREFOX_BROWSER: | ||
return remote({ | ||
path: '/wd/hub', | ||
capabilities: { | ||
browserName: FIREFOX_BROWSER, | ||
acceptInsecureCerts: true, | ||
'moz:firefoxOptions': { | ||
'prefs': { | ||
'media.navigator.streams.fake': true, | ||
'media.navigator.permission.disabled': true, | ||
'media.peerconnection.ice.tcp': true, | ||
'intl.accept_languages': 'en', | ||
'media.autoplay.default': 0 | ||
} | ||
} | ||
} | ||
}); | ||
default: | ||
return; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* eslint-disable no-undef */ | ||
|
||
/** | ||
* Function that checks if the participant is moderator. | ||
* | ||
* @returns {void} | ||
*/ | ||
export default async function isParticipantModerator() { | ||
// eslint-disable-next-line arrow-body-style | ||
await browser.execute(() => { | ||
return window.APP.store.getState()['features/base/participants'].local.role | ||
=== 'moderator'; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const ParticipantsPane = require('../page-objects/ParticipantsPane'); | ||
const Toolbox = require('../page-objects/Toolbox'); | ||
|
||
/** | ||
* Open participants pane function. | ||
* | ||
* @returns {void} | ||
*/ | ||
export default async function openParticipantsPane(userBrowser) { | ||
const getToolbox = await new Toolbox(userBrowser); | ||
const getToolboxView = await getToolbox.ToolboxView; | ||
|
||
await expect(getToolboxView).toBeDisplayed(); | ||
const participantsButton = await getToolbox.ParticipantsPaneButton; | ||
|
||
await expect(participantsButton).toBeDisplayed(); | ||
await participantsButton.click(); | ||
|
||
const participantsPanePageObject = await new ParticipantsPane(userBrowser); | ||
const participantsPane = await participantsPanePageObject.ParticipantsPaneView; | ||
|
||
await expect(participantsPane).toBeDisplayed(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* eslint-disable no-undef */ | ||
|
||
/** | ||
* Define participants pane elements. | ||
*/ | ||
class ParticipantsPane { | ||
|
||
/** | ||
* Initializes a new user browser instance. | ||
* | ||
* @param {Object} userBrowser - The read-only properties with which the new | ||
* instance is to be initialized. | ||
*/ | ||
constructor(userBrowser) { | ||
this.userBrowser = userBrowser; | ||
} | ||
|
||
/** | ||
* Participants pane element. | ||
* | ||
* @returns {HTMLElement} | ||
*/ | ||
get ParticipantsPaneView() { | ||
return this.userBrowser.$('.participants_pane'); | ||
} | ||
} | ||
module.exports = ParticipantsPane; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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