1- import { AppiumDriver , createDriver } from "nativescript-dev-appium" ;
1+ import { AppiumDriver , createDriver , nsCapabilities } from "nativescript-dev-appium" ;
22import { Screen , driverDefaultWaitTime } from "./screen"
33import {
44 roots ,
@@ -10,21 +10,24 @@ import {
1010 testDialogBackground
1111} from "./shared.e2e-spec"
1212
13- describe ( "modal-frame:" , ( ) => {
13+ describe ( "modal-frame:" , async function ( ) {
1414
1515 let driver : AppiumDriver ;
1616 let screen : Screen ;
1717
18- before ( async ( ) => {
18+ before ( async function ( ) {
19+ nsCapabilities . testReporter . context = this ;
1920 driver = await createDriver ( ) ;
2021 driver . defaultWaitTime = driverDefaultWaitTime ;
2122 screen = new Screen ( driver ) ;
2223 } ) ;
2324
24- roots . forEach ( root => {
25- describe ( `${ root } modal frame background scenarios:` , ( ) => {
25+ for ( let index = 0 ; index < roots . length ; index ++ ) {
26+ const root = roots [ index ] ;
27+ describe ( `${ root } modal frame background scenarios:` , async function ( ) {
2628
27- before ( async ( ) => {
29+ before ( async function ( ) {
30+ nsCapabilities . testReporter . context = this ;
2831 await screen [ root ] ( ) ;
2932 } ) ;
3033
@@ -40,38 +43,38 @@ describe("modal-frame:", () => {
4043 }
4144 } ) ;
4245
43- after ( async ( ) => {
46+ after ( async function ( ) {
4447 await screen . closeModal ( ) ;
4548 await screen . loadedHome ( ) ;
4649 } ) ;
4750
48- it ( "should show dialog confirm, run in background" , async ( ) => {
51+ it ( "should show dialog confirm, run in background" , async function ( ) {
4952 await testDialogBackground ( driver , screen ) ;
5053 } ) ;
5154
52- it ( "should run modal page with frame in background" , async ( ) => {
55+ it ( "should run modal page with frame in background" , async function ( ) {
5356 await modalFrameBackground ( driver , screen ) ;
5457 } ) ;
5558
56- it ( "should navigate to second page, run in background, go back" , async ( ) => {
59+ it ( "should navigate to second page, run in background, go back" , async function ( ) {
5760 await testSecondPageBackground ( driver , screen ) ;
5861 } ) ;
5962
60- it ( "should show nested modal page with frame, run in background, close" , async ( ) => {
63+ it ( "should show nested modal page with frame, run in background, close" , async function ( ) {
6164 await testNestedModalFrameBackground ( driver , screen ) ;
6265 } ) ;
6366
64- it ( "should show nested modal page, run in background, close" , async ( ) => {
67+ it ( "should show nested modal page, run in background, close" , async function ( ) {
6568 await testNestedModalPageBackground ( driver , screen ) ;
6669 } ) ;
6770
68- it ( "should navigate to second page, close" , async ( ) => {
71+ it ( "should navigate to second page, close" , async function ( ) {
6972 await testSecondPageClose ( driver , screen ) ;
7073 } ) ;
7174
72- it ( "should navigate to second page, run in background, go back" , async ( ) => {
75+ it ( "should navigate to second page, run in background, go back" , async function ( ) {
7376 await testSecondPageBackground ( driver , screen ) ;
7477 } ) ;
7578 } ) ;
76- } ) ;
79+ } ;
7780} ) ;
0 commit comments