1
1
import NavigateAppPage from '../../common/NavigateAppPage' ;
2
2
import ExperimentalLinkPageObject from '../pages/ExperimentalLinkPageObject' ;
3
3
import { EXPERIMENTAL_LINK_ACCESSIBILITY_LABEL } from '../consts' ;
4
- import { LINK_A11Y_ROLE , PAGE_TIMEOUT , BOOT_APP_TIMEOUT , Attribute } from '../../common/consts' ;
4
+ import { LINK_A11Y_ROLE , PAGE_TIMEOUT , BOOT_APP_TIMEOUT , Attribute , Keys } from '../../common/consts' ;
5
5
6
6
// Before testing begins, allow up to 60 seconds for app to open
7
7
describe ( 'Link Testing Initialization' , function ( ) {
@@ -21,6 +21,37 @@ describe('Link Testing Initialization', function () {
21
21
} ) ;
22
22
} ) ;
23
23
24
+ describe ( 'Link Testing Functionality' , function ( ) {
25
+ /* Scrolls and waits for the Link to be visible on the Test Page */
26
+ beforeEach ( async ( ) => {
27
+ await ExperimentalLinkPageObject . scrollToTestElement ( ) ;
28
+ } ) ;
29
+
30
+ it ( 'Validate OnPress() callback was fired on a click' , async ( ) => {
31
+ await ExperimentalLinkPageObject . click ( ExperimentalLinkPageObject . _secondaryComponent ) ;
32
+ await expect (
33
+ await ExperimentalLinkPageObject . didOnPressCallbackFire ( `The link failed to fire an onPress callback with a mouse click.` ) ,
34
+ ) . toBeTruthy ( ) ;
35
+ await expect ( await ExperimentalLinkPageObject . didAssertPopup ( ) ) . toBeFalsy ( ExperimentalLinkPageObject . ERRORMESSAGE_ASSERT ) ;
36
+ } ) ;
37
+
38
+ it ( 'Validate OnPress() callback was fired after hitting "Enter"' , async ( ) => {
39
+ await ExperimentalLinkPageObject . sendKeys ( ExperimentalLinkPageObject . _secondaryComponent , [ Keys . ENTER ] ) ;
40
+ await expect (
41
+ await ExperimentalLinkPageObject . didOnPressCallbackFire ( `The link failed to fire an OnPress callback with an enter keypress.` ) ,
42
+ ) . toBeTruthy ( ) ;
43
+ await expect ( await ExperimentalLinkPageObject . didAssertPopup ( ) ) . toBeFalsy ( ExperimentalLinkPageObject . ERRORMESSAGE_ASSERT ) ;
44
+ } ) ;
45
+
46
+ it ( 'Validate OnPress() callback was fired after hitting "SPACE"' , async ( ) => {
47
+ await ExperimentalLinkPageObject . sendKeys ( ExperimentalLinkPageObject . _secondaryComponent , [ Keys . SPACE ] ) ;
48
+ await expect (
49
+ await ExperimentalLinkPageObject . didOnPressCallbackFire ( `The link failed to fire an OnPress callback with a space keypress.` ) ,
50
+ ) . toBeTruthy ( ) ;
51
+ await expect ( await ExperimentalLinkPageObject . didAssertPopup ( ) ) . toBeFalsy ( ExperimentalLinkPageObject . ERRORMESSAGE_ASSERT ) ;
52
+ } ) ;
53
+ } ) ;
54
+
24
55
describe ( 'Link Accessibility Testing' , ( ) => {
25
56
beforeAll ( async ( ) => {
26
57
await ExperimentalLinkPageObject . scrollToTestElement ( ) ;
0 commit comments