Skip to content

Commit 70eb746

Browse files
authored
Update WebdriverIO to v9 for FURN tests (#3897)
* updated wdio versions and fixed tests * update text casing * Change files * update existing image to install node v22 * update yarn.lock * ran yarn install for new yarn.lock * change token * update yarn.lock with Text * specs array
1 parent 6cf2ef4 commit 70eb746

10 files changed

+1424
-176
lines changed

.ado/templates/setup-repo.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ steps:
55
versionSpec: '5.6.0'
66
displayName: 'Install Nuget'
77

8+
- task: UseNode@1
9+
inputs:
10+
version: '22.x'
11+
displayName: 'Use Node.js 22.x'
12+
813
- script: |
914
yarn
1015
displayName: 'yarn install'

apps/E2E/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@
4040
"@types/jasmine": "5.1.4",
4141
"@types/node": "^22.2.0",
4242
"@types/react": "^18.2.0",
43-
"@wdio/appium-service": "^8.40.0",
44-
"@wdio/cli": "^8.40.0",
45-
"@wdio/globals": "^8.40.0",
46-
"@wdio/jasmine-framework": "^8.40.0",
47-
"@wdio/json-reporter": "^8.40.0",
48-
"@wdio/local-runner": "^8.40.0",
49-
"@wdio/spec-reporter": "^8.40.0",
43+
"@wdio/appium-service": "^9.12.6",
44+
"@wdio/cli": "^9.12.6",
45+
"@wdio/globals": "^9.12.6",
46+
"@wdio/jasmine-framework": "^9.12.6",
47+
"@wdio/json-reporter": "^9.12.6",
48+
"@wdio/local-runner": "^9.12.6",
49+
"@wdio/spec-reporter": "^9.12.6",
5050
"appium": "^2.11.2",
5151
"appium-mac2-driver": "^1.12.0",
5252
"appium-uiautomator2-driver": "^3.0.5",
@@ -56,7 +56,7 @@
5656
"rimraf": "^5.0.1",
5757
"ts-node": "^10.7.0",
5858
"typescript": "4.9.4",
59-
"webdriverio": "^8.40.0"
59+
"webdriverio": "^9.12.6"
6060
},
6161
"installConfig": {
6262
"hoistingLimits": "dependencies"

apps/E2E/src/common/BasePage.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const PLATFORM = process.env['E2ETEST_PLATFORM'] as Platform;
2020
const NATIVE_TESTING = process.env['NATIVE_TESTING'] == 'true';
2121
export const COMPONENT_SCROLL_COORDINATES = { x: -0, y: -100 }; // These are the offsets. Y is negative because we want the touch to move up (and thus it scrolls down)
2222

23-
let rootView: WebdriverIO.Element | null = null;
23+
let rootView: WebdriverIO.Element | ChainablePromiseElement | null = null;
2424

2525
/* Win32/UWP-Specific Selector. We use this to get elements on the test page */
2626
export async function By(identifier: string) {
@@ -37,7 +37,7 @@ async function QueryWithChaining(identifier) {
3737
rootView = await $('~' + ROOT_VIEW);
3838
}
3939
const selector = '~' + identifier;
40-
let queryResult: WebdriverIO.Element;
40+
let queryResult: WebdriverIO.Element | ChainablePromiseElement;
4141
queryResult = await rootView.$(selector);
4242
if (queryResult.error) {
4343
// In some cases, such as opened ContextualMenu items, the element nodes are not children of the rootView node, meaning we need to start our search from the top of the tree.
@@ -133,7 +133,7 @@ export abstract class BasePage {
133133
* The advantage to this over testing using .isEqual in a spec is that this throws a detailed error if
134134
* the expected and actual values don't match. This should be called for attribute tests in specs. */
135135
async compareAttribute(
136-
element: Promise<WebdriverIO.Element>,
136+
element: WebdriverIO.Element | ChainablePromiseElement,
137137
attribute: Attribute | AndroidAttribute,
138138
expectedValue: any,
139139
): Promise<boolean> {

apps/E2E/wdio.conf.android.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const jasmineDefaultTimeout = 60000; // 60 seconds for Jasmine test timeout
66

77
exports.config = {
88
runner: 'local', // Where should your test be launched
9-
specs: ['src/**/specs/*.android.ts'],
9+
specs: [['src/**/specs/*.android.ts']],
1010
exclude: [],
1111

1212
maxInstances: 30,

apps/E2E/wdio.conf.ios.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const jasmineDefaultTimeout = 60000; // 60 seconds for Jasmine test timeout
66

77
exports.config = {
88
runner: 'local', // Where should your test be launched
9-
specs: ['src/**/specs/*.ios.ts'],
9+
specs: [['src/**/specs/*.ios.ts']],
1010
exclude: [],
1111

1212
maxInstances: 30,

apps/E2E/wdio.conf.macos.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const jasmineDefaultTimeout = 60000; // 60 seconds for Jasmine test timeout
66

77
exports.config = {
88
runner: 'local', // Where should your test be launched
9-
specs: ['src/**/specs/*.macos.ts'],
9+
specs: [['src/**/specs/*.macos.ts']],
1010
exclude: [
1111
/* 'path/to/excluded/files' */
1212
],
@@ -156,7 +156,7 @@ exports.config = {
156156
*/
157157
afterTest: (test, context, results) => {
158158
const resultString = results.passed ? 'Passed' : 'Failed';
159-
console.log(`\nTest Case: "${test.description}".\nResult: "${resultString}".\nDuration: "${(results.duration/600).toFixed(2)}s". \n`);
159+
console.log(`\nTest Case: "${test.description}".\nResult: "${resultString}".\nDuration: "${(results.duration / 600).toFixed(2)}s". \n`);
160160

161161
// if test passed, ignore, else take and save screenshot. Unless it's the first test that boots the app,
162162
// it may be useful to have a screenshot of the app on load.

apps/E2E/wdio.conf.win32.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const jasmineDefaultTimeout = 60000; // 60 seconds for Jasmine test timeout
1212

1313
exports.config = {
1414
runner: 'local', // Where should your test be launched
15-
specs: ['../E2E/src/**/specs/*.win.ts'],
15+
specs: [['../E2E/src/**/specs/*.win.ts']],
1616
exclude: [],
1717

1818
capabilities: [

apps/E2E/wdio.conf.windows.js

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,20 @@ exports.config = {
99
/* UWP controls are a subset of the Win32 controls. Only some work on our UWP test app,
1010
so we must specify which ones we want to test here. */
1111
specs: [
12-
'src/ActivityIndicator/specs/*.win.ts',
13-
'src/ButtonLegacy/specs/*.win.ts',
14-
'src/CheckboxLegacy/specs/*.win.ts', // See spec file for more information
15-
'src/LinkLegacy/specs/*.win.ts',
16-
'src/PersonaCoin/specs/*.win.ts',
17-
'src/Pressable/specs/*.win.ts',
18-
'src/Separator/specs/*.win.ts',
19-
'src/TabsLegacy/specs/*.windows.ts', // See spec file for more information
20-
'src/TextLegacy/specs/*.win.ts',
21-
'src/TextV1/specs/*.win.ts',
22-
'src/Theme/specs/*.win.ts',
23-
'src/Tokens/specs/*.win.ts',
12+
[
13+
'src/ActivityIndicator/specs/*.win.ts',
14+
'src/ButtonLegacy/specs/*.win.ts',
15+
'src/CheckboxLegacy/specs/*.win.ts', // See spec file for more information
16+
'src/LinkLegacy/specs/*.win.ts',
17+
'src/PersonaCoin/specs/*.win.ts',
18+
'src/Pressable/specs/*.win.ts',
19+
'src/Separator/specs/*.win.ts',
20+
'src/TabsLegacy/specs/*.windows.ts', // See spec file for more information
21+
'src/TextLegacy/specs/*.win.ts',
22+
'src/TextV1/specs/*.win.ts',
23+
'src/Theme/specs/*.win.ts',
24+
'src/Tokens/specs/*.win.ts',
25+
],
2426
],
2527
exclude: [
2628
/* 'path/to/excluded/files' */
@@ -160,7 +162,7 @@ exports.config = {
160162
*/
161163
afterTest: (test, context, results) => {
162164
const resultString = results.passed ? 'Passed' : 'Failed';
163-
console.log(`\nTest Case: "${test.description}".\nResult: "${resultString}".\nDuration: "${(results.duration/600).toFixed(2)}s". \n`);
165+
console.log(`\nTest Case: "${test.description}".\nResult: "${resultString}".\nDuration: "${(results.duration / 600).toFixed(2)}s". \n`);
164166

165167
// if test passed, ignore, else take and save screenshot.
166168
if (results.passed) {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "minor",
3+
"comment": "updated wdio versions and fixed tests",
4+
"packageName": "@fluentui-react-native/e2e-testing",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

0 commit comments

Comments
 (0)