forked from adrianyorke/robotframework-cookbook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrecipe151_working_with_browser_contexts.robot
46 lines (39 loc) · 1.85 KB
/
recipe151_working_with_browser_contexts.robot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
*** Settings ***
Documentation PROBLEM:
... You want to simulate different geolocations in the same browser instance.
... DISCUSSION:
... This recipe demonstrates the usage of contexts with different geolocations.
... The contexts are all created in the same browser and do not influence each other.
... SEE ALSO:
... Beside the geolocation it is also possible to specify more options for each context.
... For example the timezone, different permissions, Java Script is disabled,
... This recipe has the following external dependencies:
... $ pip install -U robotframework-browser
... $ rfbrowser init
Library Browser
Force Tags py3.7 py3.8
*** Variables ***
${recipe} Recipe 15.1 Working With Browser Contexts
${level} Intermediate
${category} External Library: Browser
*** Test Cases ***
Context with Geolocation set to Helsinki
New Context geolocation={'latitude': 60.1698, 'longitude': 24.9386} permissions=['geolocation']
New Page https://www.openstreetmap.org/
Click span.icon.geolocate
Wait Until Network Is Idle
Take Screenshot
Context with Geolocation set to Sydney
New Context geolocation={'latitude': -33.8675, 'longitude': 151.207} permissions=['geolocation']
New Page https://www.openstreetmap.org/
Click span.icon.geolocate
Wait Until Network Is Idle
Take Screenshot
*** Comments ***
# TODO: There is a bug in Browser library which is causing CI problems - commenting out this test case
Context with no Geolocation Permission
New Context
New Page https://www.openstreetmap.org/
Click span.icon.geolocate
Wait Until Network Is Idle
Take Screenshot