@fluentui-react-native/tester 0.106.2 → 0.107.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +24 -1
- package/CHANGELOG.md +14 -2
- package/lib/E2E/Callout/pages/CalloutPageObject.win.d.ts +3 -0
- package/lib/E2E/Callout/pages/CalloutPageObject.win.d.ts.map +1 -1
- package/lib/E2E/Callout/pages/CalloutPageObject.win.js +60 -15
- package/lib/E2E/Callout/pages/CalloutPageObject.win.js.map +1 -1
- package/lib/E2E/Callout/specs/Callout.spec.win.js +110 -22
- package/lib/E2E/Callout/specs/Callout.spec.win.js.map +1 -1
- package/lib/TestComponents/Avatar/consts.d.ts +1 -1
- package/lib/TestComponents/Avatar/consts.d.ts.map +1 -1
- package/lib/TestComponents/Avatar/consts.js +1 -1
- package/lib/TestComponents/Avatar/consts.js.map +1 -1
- package/lib/TestComponents/Callout/CalloutE2ETest.d.ts.map +1 -1
- package/lib/TestComponents/Callout/CalloutE2ETest.js +33 -19
- package/lib/TestComponents/Callout/CalloutE2ETest.js.map +1 -1
- package/lib/TestComponents/Persona/StandardUsage.js +2 -2
- package/lib/TestComponents/Persona/StandardUsage.js.map +1 -1
- package/lib/TestComponents/Persona/styles.d.ts +2 -2
- package/lib/TestComponents/Persona/styles.d.ts.map +1 -1
- package/lib/TestComponents/Persona/styles.js +2 -2
- package/lib/TestComponents/Persona/styles.js.map +1 -1
- package/lib/testPages.js +1 -1
- package/lib/testPages.js.map +1 -1
- package/lib-commonjs/E2E/Callout/pages/CalloutPageObject.win.d.ts +3 -0
- package/lib-commonjs/E2E/Callout/pages/CalloutPageObject.win.d.ts.map +1 -1
- package/lib-commonjs/E2E/Callout/pages/CalloutPageObject.win.js +59 -14
- package/lib-commonjs/E2E/Callout/pages/CalloutPageObject.win.js.map +1 -1
- package/lib-commonjs/E2E/Callout/specs/Callout.spec.win.js +112 -24
- package/lib-commonjs/E2E/Callout/specs/Callout.spec.win.js.map +1 -1
- package/lib-commonjs/TestComponents/Avatar/consts.d.ts +1 -1
- package/lib-commonjs/TestComponents/Avatar/consts.d.ts.map +1 -1
- package/lib-commonjs/TestComponents/Avatar/consts.js +1 -1
- package/lib-commonjs/TestComponents/Avatar/consts.js.map +1 -1
- package/lib-commonjs/TestComponents/Callout/CalloutE2ETest.d.ts.map +1 -1
- package/lib-commonjs/TestComponents/Callout/CalloutE2ETest.js +32 -19
- package/lib-commonjs/TestComponents/Callout/CalloutE2ETest.js.map +1 -1
- package/lib-commonjs/TestComponents/Persona/StandardUsage.js +1 -1
- package/lib-commonjs/TestComponents/Persona/StandardUsage.js.map +1 -1
- package/lib-commonjs/TestComponents/Persona/styles.d.ts +2 -2
- package/lib-commonjs/TestComponents/Persona/styles.d.ts.map +1 -1
- package/lib-commonjs/TestComponents/Persona/styles.js +3 -3
- package/lib-commonjs/TestComponents/Persona/styles.js.map +1 -1
- package/lib-commonjs/testPages.js +1 -1
- package/lib-commonjs/testPages.js.map +1 -1
- package/package.json +1 -1
- package/src/E2E/Callout/pages/CalloutPageObject.win.ts +23 -4
- package/src/E2E/Callout/specs/Callout.spec.win.ts +40 -24
- package/src/TestComponents/Avatar/consts.ts +1 -1
- package/src/TestComponents/Callout/CalloutE2ETest.tsx +41 -21
- package/src/TestComponents/Persona/StandardUsage.tsx +8 -8
- package/src/TestComponents/Persona/styles.ts +3 -3
- package/src/testPages.ts +1 -1
- package/wdio.conf.windows.js +0 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import NavigateAppPage from '../../common/NavigateAppPage';
|
|
2
2
|
import CalloutPageObject from '../pages/CalloutPageObject.win';
|
|
3
|
-
import {
|
|
3
|
+
import { CALLOUT_ACCESSIBILITY_LABEL } from '../../../TestComponents/Callout/consts';
|
|
4
|
+
import { PAGE_TIMEOUT, BOOT_APP_TIMEOUT, CALLOUT_A11Y_ROLE } from '../../common/consts';
|
|
5
|
+
import { ComponentSelector } from '../../common/BasePage';
|
|
4
6
|
|
|
5
7
|
// Before testing begins, allow up to 60 seconds for app to open
|
|
6
8
|
describe('Callout Testing Initialization', function () {
|
|
@@ -19,26 +21,40 @@ describe('Callout Testing Initialization', function () {
|
|
|
19
21
|
});
|
|
20
22
|
});
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
24
|
+
describe('Callout Accessibility Testing', () => {
|
|
25
|
+
beforeAll(async () => {
|
|
26
|
+
await CalloutPageObject.scrollToTestElement();
|
|
27
|
+
await CalloutPageObject.openCallout();
|
|
28
|
+
await CalloutPageObject.waitForCalloutComponentInView(PAGE_TIMEOUT);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('Validate accessibilityRole is correct', async () => {
|
|
32
|
+
await expect(await CalloutPageObject.getAccessibilityRole()).toEqual(CALLOUT_A11Y_ROLE);
|
|
33
|
+
await expect(await CalloutPageObject.didAssertPopup()).toBeFalsy(CalloutPageObject.ERRORMESSAGE_ASSERT); // Ensure no asserts popped up
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('Set accessibilityLabel', async () => {
|
|
37
|
+
await expect(await CalloutPageObject.getAccessibilityLabel(ComponentSelector.Primary)).toEqual(CALLOUT_ACCESSIBILITY_LABEL);
|
|
38
|
+
await expect(await CalloutPageObject.didAssertPopup()).toBeFalsy(CalloutPageObject.ERRORMESSAGE_ASSERT); // Ensure no asserts popped up
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
afterAll(async () => {
|
|
42
|
+
await CalloutPageObject.closeCallout();
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
describe('Callout Functional Testing', () => {
|
|
47
|
+
beforeEach(async () => {
|
|
48
|
+
await CalloutPageObject.scrollToTestElement();
|
|
49
|
+
await CalloutPageObject.openCallout();
|
|
50
|
+
await CalloutPageObject.waitForCalloutComponentInView(PAGE_TIMEOUT);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('Open the callout and validate it loaded correctly (visible)', async () => {
|
|
54
|
+
await expect(await CalloutPageObject.didCalloutLoad()).toBeTruthy();
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
afterEach(async () => {
|
|
58
|
+
await CalloutPageObject.closeCallout();
|
|
59
|
+
});
|
|
60
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const HOMEPAGE_AVATAR_BUTTON = 'Homepage_Avatar_Button';
|
|
2
2
|
export const HOMEPAGE_NATIVE_AVATAR_BUTTON = 'Homepage_Native_Avatar_Button';
|
|
3
3
|
export const NATIVE_AVATAR_TESTPAGE = 'NativeAvatar_TestPage';
|
|
4
|
-
export const AVATAR_TESTPAGE = '
|
|
4
|
+
export const AVATAR_TESTPAGE = 'Avatar_TestPage';
|
|
5
5
|
|
|
6
6
|
export const AVATAR_ACCESSIBILITY_LABEL = 'E2E Avatar Accessibility label';
|
|
7
7
|
export const AVATAR_ACCESSIBILITY_LABEL_BY_NAME = 'Richard, available';
|
|
@@ -1,46 +1,66 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ScreenRect,
|
|
3
|
-
import { Button, Callout } from '@fluentui/react-native';
|
|
4
|
-
import {
|
|
2
|
+
import { ScreenRect, View } from 'react-native';
|
|
3
|
+
import { ButtonV1 as Button, Callout, Text, DismissBehaviors } from '@fluentui/react-native';
|
|
4
|
+
import { Switch } from '@fluentui-react-native/switch';
|
|
5
|
+
import { BUTTON_TO_OPEN_CALLOUT, CALLOUT_ACCESSIBILITY_LABEL, CALLOUT_TEST_COMPONENT } from './consts';
|
|
5
6
|
|
|
6
7
|
export const E2ECalloutTest: React.FunctionComponent = () => {
|
|
7
|
-
const [
|
|
8
|
-
const [
|
|
8
|
+
const [showCallout, setShowCallout] = React.useState(false);
|
|
9
|
+
const [isCalloutVisible, setIsCalloutVisible] = React.useState(false);
|
|
10
|
+
const [dismissBehaviors, setDismissBehaviors] = React.useState({
|
|
11
|
+
preventDismissOnKeyDown: false,
|
|
12
|
+
preventDismissOnClickOutside: false,
|
|
13
|
+
});
|
|
9
14
|
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}, [
|
|
15
|
+
const toggleShowCallout = React.useCallback(() => {
|
|
16
|
+
setShowCallout(!showCallout);
|
|
17
|
+
setIsCalloutVisible(false);
|
|
18
|
+
}, [showCallout, setIsCalloutVisible, setShowCallout]);
|
|
14
19
|
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
}, [
|
|
20
|
+
const onShowCallout = React.useCallback(() => {
|
|
21
|
+
setIsCalloutVisible(true);
|
|
22
|
+
}, [setIsCalloutVisible]);
|
|
18
23
|
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}, [
|
|
24
|
+
const onDismissCallout = React.useCallback(() => {
|
|
25
|
+
setIsCalloutVisible(false);
|
|
26
|
+
setShowCallout(false);
|
|
27
|
+
}, [setIsCalloutVisible, setShowCallout]);
|
|
23
28
|
|
|
24
29
|
const myRect: ScreenRect = { screenX: 10, screenY: 10, width: 100, height: 100 };
|
|
25
30
|
|
|
26
31
|
return (
|
|
27
32
|
<View>
|
|
28
33
|
<View style={{ flexDirection: 'column', paddingVertical: 5 }}>
|
|
29
|
-
<
|
|
34
|
+
<Text variant="subheaderSemibold">Dismiss Behaviors</Text>
|
|
35
|
+
<View style={{ flexDirection: 'row', paddingVertical: 5 }}>
|
|
36
|
+
{Object.entries(dismissBehaviors).map(([behavior, checked], i) => (
|
|
37
|
+
<Switch
|
|
38
|
+
label={behavior}
|
|
39
|
+
checked={checked}
|
|
40
|
+
onChange={(_, isChecked) => setDismissBehaviors({ ...dismissBehaviors, [behavior]: isChecked })}
|
|
41
|
+
key={i}
|
|
42
|
+
/>
|
|
43
|
+
))}
|
|
44
|
+
</View>
|
|
45
|
+
<Button onClick={toggleShowCallout} testID={BUTTON_TO_OPEN_CALLOUT}>
|
|
46
|
+
Press for Callout
|
|
47
|
+
</Button>
|
|
30
48
|
<Text selectable={true}>
|
|
31
49
|
<Text>Visibility: </Text>
|
|
32
|
-
{
|
|
50
|
+
{isCalloutVisible ? <Text style={{ color: 'green' }}>Visible</Text> : <Text style={{ color: 'red' }}>Not Visible</Text>}
|
|
33
51
|
</Text>
|
|
34
52
|
</View>
|
|
35
53
|
|
|
36
|
-
{
|
|
54
|
+
{showCallout && (
|
|
37
55
|
<Callout
|
|
56
|
+
testID={CALLOUT_TEST_COMPONENT}
|
|
38
57
|
anchorRect={myRect}
|
|
39
|
-
onDismiss={
|
|
40
|
-
onShow={
|
|
58
|
+
onDismiss={onDismissCallout}
|
|
59
|
+
onShow={onShowCallout}
|
|
41
60
|
accessibilityLabel={CALLOUT_ACCESSIBILITY_LABEL}
|
|
42
61
|
accessibilityRole="alert"
|
|
43
62
|
accessibilityOnShowAnnouncement="Be informed that a customized callout has been opened."
|
|
63
|
+
dismissBehaviors={Object.keys(dismissBehaviors).filter((behavior) => dismissBehaviors[behavior]) as DismissBehaviors[]}
|
|
44
64
|
>
|
|
45
65
|
<View style={{ padding: 20, borderWidth: 2, borderColor: 'black' }}>
|
|
46
66
|
<Text>just some text so it does not take focus and is not empty.</Text>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Persona, PersonaSize } from '@fluentui/react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { satyaImageUrl } from './styles';
|
|
4
4
|
import { commonTestStyles as commonStyles } from '../Common/styles';
|
|
5
5
|
import { View, Text, Switch } from 'react-native';
|
|
6
6
|
import { undefinedText } from '../PersonaCoin/styles';
|
|
@@ -71,14 +71,14 @@ export const StandardUsage: React.FunctionComponent = () => {
|
|
|
71
71
|
</View>
|
|
72
72
|
|
|
73
73
|
<Persona
|
|
74
|
-
text={showPrimary ? '
|
|
75
|
-
secondaryText={showSecondary ? '
|
|
76
|
-
tertiaryText={showTertiary ? '
|
|
77
|
-
optionalText={showOptional ? '
|
|
74
|
+
text={showPrimary ? 'Satya Nadella' : undefined}
|
|
75
|
+
secondaryText={showSecondary ? 'CEO' : undefined}
|
|
76
|
+
tertiaryText={showTertiary ? 'Microsoft' : undefined}
|
|
77
|
+
optionalText={showOptional ? 'Office of the CEO' : undefined}
|
|
78
78
|
size={imageSize}
|
|
79
|
-
initials="
|
|
80
|
-
imageUrl={showImage ?
|
|
81
|
-
imageDescription="Profile photo of
|
|
79
|
+
initials="SN"
|
|
80
|
+
imageUrl={showImage ? satyaImageUrl : undefined}
|
|
81
|
+
imageDescription="Profile photo of Satya Nadella"
|
|
82
82
|
presence={'away'}
|
|
83
83
|
/>
|
|
84
84
|
</View>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from '../PersonaCoin/styles';
|
|
2
2
|
|
|
3
|
-
export const
|
|
4
|
-
'https://
|
|
3
|
+
export const satyaImageUrl =
|
|
4
|
+
'https://upload.wikimedia.org/wikipedia/commons/thumb/7/78/MS-Exec-Nadella-Satya-2017-08-31-22_%28cropped%29.jpg/330px-MS-Exec-Nadella-Satya-2017-08-31-22_%28cropped%29.jpg';
|
|
5
5
|
|
|
6
|
-
export const michaelImageUrl = 'https://
|
|
6
|
+
export const michaelImageUrl = 'https://upload.wikimedia.org/wikipedia/commons/3/31/Michael_Jackson_in_1988.jpg';
|
package/src/testPages.ts
CHANGED
package/wdio.conf.windows.js
CHANGED
|
@@ -11,7 +11,6 @@ exports.config = {
|
|
|
11
11
|
specs: [
|
|
12
12
|
'src/E2E/ActivityIndicator/specs/*.win.ts',
|
|
13
13
|
'src/E2E/Button/specs/*.win.ts',
|
|
14
|
-
'src/E2E/Callout/specs/*.win.ts',
|
|
15
14
|
'src/E2E/Checkbox/specs/*.windows.ts', // See spec file for more information
|
|
16
15
|
'src/E2E/Link/specs/*.win.ts',
|
|
17
16
|
'src/E2E/PersonaCoin/specs/*.win.ts',
|