Skip to content

Commit 65fe0c8

Browse files
committed
Improved testing instructions
1 parent d5582b8 commit 65fe0c8

File tree

2 files changed

+133
-89
lines changed

2 files changed

+133
-89
lines changed

SampleApps/WebView2APISample/documentation/Testing-Instructions.md

Lines changed: 133 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ These are instructions for manually testing all the features of the WebView2 API
4747
* [Toggle builtin error page enabled](#Toggle-builtin-error-page-enabled)
4848
* [View](#View)
4949
* [Toggle Visibility](#Toggle-Visibility)
50+
* [WebView Bounds Reference](#WebView-Bounds-Reference)
5051
* [WebView Area](#WebView-Area)
5152
* [WebView Zoom](#WebView-Zoom)
5253
* [WebView Scale](#WebView-Scale)
@@ -63,6 +64,7 @@ These are instructions for manually testing all the features of the WebView2 API
6364
* [Miscellaneous](#Miscellaneous)
6465
* [Accelerator Key Support](#Accelerator-Key-Support)
6566
* [Language](#Language)
67+
* [Saving Password](#Saving-Password)
6668

6769
## Getting started
6870

@@ -167,7 +169,7 @@ Test that prompts the user for some JSON web message to the top level document
167169
168170
Test that prompts the user for some script to run as the initialization script
169171
170-
Test that prompts the user for the ID of the initialize scripts that the user would like to remove
172+
Test that prompts the user for the ID of the initialize scripts that the user would like to remove
171173
_Scripts are executed after the global object has been created and before the HTML document has been parsed every navigation_
172174
173175
1. Launch the sample app.
@@ -291,17 +293,15 @@ Test browser process becoming unresponsive
291293
2. Navigate to `edge://hang`.
292294
3. Wait ~20-30 seconds.
293295
4. Expected: Error dialog popup that says `Browser renderer process stopped responding. Recreate webview?`\
294-
![step 3](screenshots/unresponsive-renderer-error.png)\
295-
Note: 'This page isn't responding' dialog does not display if the hang is triggered via injecting script: `while (1) { console.log('hang') }`
296+
![step 3](screenshots/unresponsive-renderer-error.png)
296297
5. Click `Yes` inside the Popup dialog
297298
6. Expected: The app window resets to the same state as step 1.
298299
299300
### Settings
300301
301302
#### Blocked Domains
302303
303-
Test that prompts user for sites to block
304-
304+
Test that prompts user for sites to block
305305
_It includes foo.com and bar.org by default_
306306
307307
1. Launch the sample app.
@@ -318,8 +318,7 @@ _It includes foo.com and bar.org by default_
318318
319319
#### Set User Agent
320320
321-
Test that prompts the user for a new user agent string and sets user agent
322-
321+
Test that prompts the user for a new user agent string and sets user agent
323322
_It only modifies the header for HTTP. Change won't be reflected if checked with `navigator.userAgent`_
324323
325324
1. Launch the sample app.
@@ -336,8 +335,7 @@ _It only modifies the header for HTTP. Change won't be reflected if checked with
336335
337336
#### Toggle JavaScript
338337
339-
Test that enables/disables JavaScript
340-
338+
Test that enables/disables JavaScript
341339
_It is enabled by default. `Script -> Inject Script` won't be affected if disabled._
342340
343341
1. Launch the sample app.
@@ -353,8 +351,7 @@ _It is enabled by default. `Script -> Inject Script` won't be affected if disabl
353351
354352
#### Toggle Web Messaging
355353
356-
Test that enables/disables web messaging
357-
354+
Test that enables/disables web messaging
358355
_It is enabled by default._
359356
360357
1. Launch the sample app.
@@ -370,8 +367,7 @@ _It is enabled by default._
370367
371368
#### Toggle Fullscreen allowed
372369
373-
Test the allows/disallows Fullscreen mode
374-
370+
Test the allows/disallows Fullscreen mode
375371
_It is allowed by default._
376372
377373
1. Launch the sample app.
@@ -389,8 +385,7 @@ _It is allowed by default._
389385
390386
#### Toggle Status Bar enabled
391387
392-
Test that enables/disables Status Bar
393-
388+
Test that enables/disables Status Bar
394389
_It is enabled by default._
395390
396391
1. Launch the sample app.
@@ -408,8 +403,7 @@ _It is enabled by default._
408403
409404
#### Toggle DevTools enabled
410405
411-
Test that enables/disables DevTools
412-
406+
Test that enables/disables DevTools
413407
_It is enabled by default._
414408
415409
1. Launch the sample app.
@@ -428,8 +422,7 @@ _It is enabled by default._
428422
429423
#### Toggle ZoomControl enabled
430424
431-
Test that enables/disables Zoom
432-
425+
Test that enables/disables Zoom
433426
_It is enabled by default._
434427
435428
1. Launch the sample app.
@@ -447,8 +440,7 @@ _It is enabled by default._
447440
448441
#### Toggle Block images
449442
450-
Test that enables/disables image blocking
451-
443+
Test that enables/disables image blocking
452444
_It is disabled by default. Data URI won't e affected if disabled._
453445
454446
1. Launch the sample app.
@@ -495,8 +487,7 @@ Tests JavaScript Dialogs with different configurations
495487
496488
#### Toggle context menus enabled
497489
498-
Test that enables/disables context menu blocking
499-
490+
Test that enables/disables context menu blocking
500491
_Context menus are enabled by default._
501492
502493
1. Launch the sample app.
@@ -513,8 +504,7 @@ _Context menus are enabled by default._
513504
514505
#### Toggle builtin error page enabled
515506
516-
Test that enables/disables built-in error page
517-
507+
Test that enables/disables built-in error page
518508
_Builtin error page is enabled by default._
519509
520510
1. Launch the sample app.
@@ -541,68 +531,109 @@ _Builtin error page is enabled by default._
541531
Test that makes WebView visible/invisible
542532
543533
1. Launch the sample app.
544-
2. Go to `View -> Toggle Visibility`
545-
3. Expected: The WebView becomes invisible
546-
4. Repeat step 2
547-
5. Expected: The WebView becomes visible
534+
1. Go to `View -> Toggle Visibility`
535+
1. Expected: The WebView becomes invisible
536+
1. Repeat step 2
537+
1. Expected: The WebView becomes visible
548538
549-
#### WebView Area
539+
#### WebView Bounds Reference
540+
541+
Notes:
542+
543+
* Top is always 32 (or some non-zero value) to account for sample app UI such as menu bar and address bar
544+
* WebView height is (Bottom - Top)
545+
* WebView width is equal to Right
546+
547+
##### Bounds A
548+
549+
Left: 0
550+
Top: 32
551+
Right: 1424
552+
Bottom: 700
553+
554+
or, the default WebView bounds before any scaling/resizing
550555
551-
Test that resizes WebView window
556+
##### Bounds B
552557
558+
Left: 0
559+
Top: 32
560+
Right: 712
561+
Bottom: 366
562+
563+
or, height/width should be 0.5x of [Bounds A](#bounds-A)
564+
565+
##### Bounds C
566+
567+
Left: 0
568+
Top: 32
569+
Right: 1006
570+
Bottom: 504
571+
572+
or, height/width should be ~1.414x of [Bounds A](#bounds-A)
573+
574+
##### Bounds D
575+
576+
Left: 0
577+
Top: 32
578+
Right: 1509
579+
Bottom: 740
580+
581+
or, height/width should be ~1.06x of [Bounds A](#bounds-A)
582+
583+
#### WebView Area
584+
585+
Test that resizes WebView window
553586
_Updates the bounds of the WebView window to resize_
554587
555588
1. Launch the sample app.
556-
2. Go to `View -> WebView Area -> Get WebView Bounds`. Note the current bounds.
557-
3. Go to `View -> WebView Area -> 25%`
558-
4. Go to `View -> WebView Area -> Get WebView Bounds`.
559-
5. Expected: WebView size ratio is 25% of bounds in step 2 and WebView was resized.
560-
6. Go to `View -> WebView Area -> 50%`
561-
7. Go to `View -> WebView Area -> Get WebView Bounds`.
562-
8. Expected: WebView size ratio to 50% of bounds in step 2 and WebView was resized.
563-
9. Go to `View -> WebView Area -> 100%`
564-
10. Go to `View -> WebView Area -> Get WebView Bounds`.
565-
11. Expected: WebView size matches bounds in step 2 and WebView was resized.
589+
1. Go to `View -> WebView Area -> Get WebView Bounds`. Note the current bounds. (See [Bounds A](#Bounds-A))
590+
1. Go to `View -> WebView Area -> 25%`
591+
1. Go to `View -> WebView Area -> Get WebView Bounds`.
592+
1. Expected: WebView size ratio is 25% of bounds in step 2 and WebView was resized. (See [Bounds B](#Bounds-B))
593+
1. Go to `View -> WebView Area -> 50%`
594+
1. Go to `View -> WebView Area -> Get WebView Bounds`.
595+
1. Expected: WebView size ratio to 50% of bounds in step 2 and WebView was resized. (See [Bounds C](#Bounds-C))
596+
1. Go to `View -> WebView Area -> 100%`
597+
1. Go to `View -> WebView Area -> Get WebView Bounds`.
598+
1. Expected: WebView size matches bounds in step 2 and WebView was resized.
566599
567600
#### WebView Zoom
568601
569-
Test that zooms in/out WebView
570-
602+
Test that zooms in/out WebView
571603
_WebView maintains host set zoom factor across navigations_
572604
573605
1. Launch the sample app.
574-
2. Go to `View -> WebView Zoom -> 0.5x`
575-
3. Go to `View -> WebView Zoom -> Get WebView Zoom`
576-
4. Expected: WebView zoom factor is set to 0.5x
577-
5. Click inside the WebView, then type ctrl+ +.
578-
6. Go to `View -> WebView Zoom -> Get WebView Zoom`
579-
7. Expected: WebView zoom factor is set to .66x
580-
8. Load <https://www.google.com>
581-
9. Go to `View -> WebView Zoom -> Get WebView Zoom`
582-
10. Expected: WebView zoom factor is set to .5x
583-
11. Go to `View -> WebView Zoom -> 2x`
584-
12. Go to `View -> WebView Zoom -> Get WebView Zoom`
585-
13. Expected: WebView zoom factor is set to 2x
586-
14. Click `Back`
587-
15. Go to `View -> WebView Zoom -> Get WebView Zoom`
588-
16. Expected: WebView zoom factor is set to 2x
606+
1. Go to `View -> WebView Zoom -> 0.5x`
607+
1. Go to `View -> WebView Zoom -> Get WebView Zoom`
608+
1. Expected: WebView zoom factor is set to 0.5x
609+
1. Click inside the WebView, then type ctrl+ +.
610+
1. Go to `View -> WebView Zoom -> Get WebView Zoom`
611+
1. Expected: WebView zoom factor is set to .66x
612+
1. Load <https://www.google.com>
613+
1. Go to `View -> WebView Zoom -> Get WebView Zoom`
614+
1. Expected: WebView zoom factor is set to .5x
615+
1. Go to `View -> WebView Zoom -> 2x`
616+
1. Go to `View -> WebView Zoom -> Get WebView Zoom`
617+
1. Expected: WebView zoom factor is set to 2x
618+
1. Click `Back`
619+
1. Go to `View -> WebView Zoom -> Get WebView Zoom`
620+
1. Expected: WebView zoom factor is set to 2x
589621
590622
#### WebView Scale
591623
592-
Test scaling the WebView.
593-
624+
Test scaling the WebView.
594625
_Scale is a resize and zoom that happens atomically. It results in the WebView
595626
getting larger or smaller without the layout of the page changing._
596627
597628
1. Launch the sample app.
598-
2. Go to `View -> WebView Area -> 50%`
599-
3. Go to `View -> WebView Area -> Get WebView Bounds`. Note the current bounds.
600-
4. Go to `View -> WebView Scale -> 1.5x`
601-
5. Go to `View -> WebView Area -> Get WebView Bounds`
602-
6. Expected: WebView size is 1.5x larger than bounds in step 2.
603-
7. Go to `View -> WebView Zoom -> Get WebView Zoom`
604-
8. Expected: WebView zoom factor is set to 1.5x
605-
9. Expected: WebView renders at the new size/zoom (looks larger) without the
629+
1. Go to `View -> WebView Area -> 50%`
630+
1. Go to `View -> WebView Area -> Get WebView Bounds`. Note the current bounds. (See [Bounds B](#Bounds-B))
631+
1. Go to `View -> WebView Scale -> 1.5x`
632+
1. Go to `View -> WebView Area -> Get WebView Bounds`
633+
1. Expected: WebView size is 1.5x larger than bounds in step 2. (See [Bounds D](#Bounds-D))
634+
1. Go to `View -> WebView Zoom -> Get WebView Zoom`
635+
1. Expected: WebView zoom factor is set to 1.5x
636+
1. Expected: WebView renders at the new size/zoom (looks larger) without the
606637
layout of the page changing (elements are still in the same position relative
607638
to other elements).
608639
@@ -611,45 +642,44 @@ getting larger or smaller without the layout of the page changing._
611642
Test that sets focus into WebView
612643
613644
1. Launch the sample app.
614-
2. Click on the Bing search bar and press `Tab` key once, which sets the focus to the audio icon
615-
3. Click `Cancel` in the app window, which moves the focus from the WebView to the app window
616-
4. Go to `View -> Set Focus`
617-
5. Expected: See the focus is moved back the camera icon, which was the last focus in the WebView
645+
1. Click on the Bing search bar and press `Tab` key once, which sets the focus to the audio icon
646+
1. Click on the address bar in the app window, which moves the focus from the WebView to the app window
647+
1. Go to `View -> Set Focus`
648+
1. Expected: See the focus is moved back the audio icon, which was the last focus in the WebView
618649
619650
#### Tab In
620651
621652
Test that moves focus due to Tab traversal forward
622653
623654
1. Launch the sample app.
624-
2. Go to `View -> Tab In`
625-
3. Expected: See the focus is set to the Bing search bar (the first element) in the WebView
655+
1. Go to `View -> Tab In`
656+
1. Expected: See the focus is set to the Bing search bar (the first element) in the WebView
626657
627658
#### ReverseTab In
628659
629660
Test that moves focus due to Tab traversal backward
630661
631662
1. Launch the sample app and load <https://www.google.com>
632-
2. Go to `View -> Reverse Tab In`
633-
3. Expected: See the focus is set to `How Search works` in Google (the last element).
663+
1. Go to `View -> Reverse Tab In`
664+
1. Expected: See the focus is set to `How Search works` in Google (the last element).
634665
635666
#### Toggle Tab Handling
636667
637-
Test that enables/disables tab handling
638-
668+
Test that enables/disables tab handling
639669
_It is disabled by default. Tabbing behavior should be identical whether this is enabled or disabled._
640670
641671
1. Launch the sample app and load <https://www.google.com>
642-
2. Click address bar
643-
3. Press `Tab` twice (-> `Go` -> first element in WebView)
644-
4. Expected: See the focus is set to `About` in Google (the first element) in the WebView.
645-
5. Press `Shift+Tab`
646-
6. Expected: See the focus is set to `Go` with the dotted line.
647-
7. Press `Shift+Tab` 4 times (-> address bar -> `Cancel` -> `Reload` -> last element in WebView)
648-
8. Expected: See the focus is set to the `How Search works` in Google (the last element) with the dotted line in the WebView.
649-
9. Press `Tab`
650-
10. Expected: See the focus is set to `Reload` with the dotted line.
651-
11. Go to `View -> Toggle Tab Handling` (Enabling Tab Handling)
652-
12. Repeat steps 2-10 above.
672+
1. Click address bar
673+
1. Press `Tab` twice (-> `Go` -> first element in WebView)
674+
1. Expected: See the focus is set to `About` in Google (the first element) in the WebView.
675+
1. Press `Shift+Tab`
676+
1. Expected: See the focus is set to `Go` with the dotted line.
677+
1. Press `Shift+Tab` 4 times (-> address bar -> `Reload` -> `Back` -> last element in WebView)
678+
1. Expected: See the focus is set to the `How Search works` in Google (the last element) with the dotted line in the WebView.
679+
1. Press `Tab`
680+
1. Expected: See the focus is set to `Back` with the dotted line.
681+
1. Go to `View -> Toggle Tab Handling` (Enabling Tab Handling)
682+
1. Repeat steps 2-10 above.
653683
654684
### Scenario
655685
@@ -820,3 +850,17 @@ Verify that language and conflicting configuration works
820850
9. After WebView recreation, right click on the page after webview recreation, expect that the context menu is shown in Spanish.
821851
10. Launch another instance of the sample app.
822852
11. Expect the new instance to show a dialog stating `Failed to create webview: 0x8007139f`.
853+
854+
#### Saving Password
855+
856+
Verify that we don't offer saving password.
857+
858+
1. Launch the sample app.
859+
2. Load https://www.w3schools.com/Tags/tryit.asp?filename=tryhtml5_input_type_password, ignore any iframe navigation failure messages during the test.
860+
3. Type in some test email and password, like [email protected] and 12345678 in Email and Password field on the right part of the page.
861+
4. Click `Submit` button, the page should show the inputed values.
862+
5. Make sure that there is no browser prompt for saving password with strings like `Microsoft Edge will save and fill your password for this site next time`.
863+
6. Reload the page, ignore any iframe navigation failure messages during the test.
864+
7. Ensure that the fields are not auto filled.
865+
8. Set focus on Email input, verify that we can choose to auto fill with previously typed in value.
866+
9. Set focus on Password input, verify that there is no auto fill option showing up.
65.1 KB
Loading

0 commit comments

Comments
 (0)