Skip to content

Commit 2bdf572

Browse files
committed
excluded keywords
1 parent 4a96c83 commit 2bdf572

File tree

1 file changed

+16
-143
lines changed

1 file changed

+16
-143
lines changed

demo/tests/02_web_app/browser.robot

Lines changed: 16 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -3,65 +3,31 @@ Documentation Example browser tests
33
44
Library Browser
55

6+
Resource example/config/webapp.resource
7+
Resource example/browser/todo_app.resource
68

7-
8-
*** Variables ***
9-
${BROWSER}= chromium
10-
${HEADLESS}= False
11-
${WEB_APP_URL}= localhost
12-
${PORT}= 3000
13-
14-
${TODO_INPUT}= input[id="todo-input"]
15-
${ADD_BUTTON}= button[id="add-todo-button"]
16-
${TODO_ID}= ${0}
9+
Test Setup New Page ${WEB_APP_URL}:${PORT}
1710

1811

1912
*** Test Cases ***
20-
Check App Title Test Environment
21-
[Documentation] Verifies the app title for the test environment
22-
[Tags] test-env app-title
23-
VAR ${PORT}= 3000 scope=SUITE # noqa
24-
Open Todo App
25-
Check App Title Test: Todo App
26-
27-
Check App Title Development Environment
28-
[Documentation] Verifies the app title for the test environment
29-
[Tags] dev-env app-title
30-
VAR ${PORT}= 3001 scope=SUITE # noqa
31-
Open Todo App
32-
Check App Title Development: Todo App
33-
34-
Check Test Environment Header
35-
[Documentation] Checks if the web app is in the test environment
36-
[Tags] test-env env-header
37-
VAR ${PORT}= 3000 scope=SUITE # noqa
38-
Open Todo App
39-
Check Header Environment Test Environment
40-
41-
Check Development Environment Header
42-
[Documentation] Checks if the web app is in the development environment
43-
[Tags] dev-env env-header
44-
VAR ${PORT}= 3001 scope=SUITE # noqa
45-
Open Todo App
46-
Check Header Environment Development Environment
13+
Check App Title
14+
[Documentation] Verifies the app title of the environment
15+
[Tags] title
16+
Get Title == ${APP_TITLE}
4717

48-
Check Test Environment Color
49-
[Documentation] Checks the color of the header in test environment
50-
[Tags] test-env color
51-
VAR ${PORT}= 3000 scope=SUITE # noqa
52-
Open Todo App
53-
Check Header Color bg-red-400
18+
Check Header Content
19+
[Documentation] Checks if the header content corresponds to the environment
20+
[Tags] header
21+
Get Text //div[@id="environment"] == ${APP_HEADER}
5422

55-
Check Development Environment Color
56-
[Documentation] Checks the color of the header in development environment
57-
[Tags] dev-env color
58-
VAR ${PORT}= 3001 scope=SUITE # noqa
59-
Open Todo App
60-
Check Header Color bg-blue-400
23+
Check Header Color
24+
[Documentation] Checks the color of the header depending on the environment
25+
[Tags] color
26+
Get Attribute //div[@id="environment"] class contains ${APP_COLOR}
6127

6228
Verify Url Navigation
6329
[Documentation] Verifies the functionality of the url navigation
64-
Open Todo App
30+
[Tags] functional
6531
Wait Until Keyword Succeeds 5s 500ms Verify Url Ends With todo
6632
Click a[href="#/done"]
6733
Wait Until Keyword Succeeds 5s 500ms Verify Url Ends With done
@@ -70,7 +36,6 @@ Add And Delete Single Todo
7036
[Documentation] Tests the creation and deletion of a single todo in the app
7137
[Tags] regression
7238
VAR @{todos} Hold Robocon Workshop
73-
Open Todo App
7439
Add Todos To List @{todos}
7540
Verify Todos Exist @{todos}
7641
Mark Todos As Done @{todos}
@@ -87,101 +52,9 @@ Add And Delete Multiple Todos
8752
... Develop Testautomation
8853
... Visit Sauna
8954
... Get Some Beers
90-
Open Todo App
9155
Add Todos To List @{todos}
9256
Verify Todos Exist @{todos}
9357
Mark Todos As Done @{todos}
9458
Verify Todos Are Done @{todos}
9559
Delete Done Elements @{todos}
9660
Verify Elements Are Deleted @{todos}
97-
98-
99-
*** Keywords ***
100-
Open Todo App
101-
[Documentation] Opens the webapp on localhost
102-
New Page ${WEB_APP_URL}:${PORT}
103-
104-
Check App Title
105-
[Documentation] Checks the app title against the expected value
106-
[Arguments] ${expected_title}
107-
${current_title} Get Title
108-
Should Be Equal ${expected_title} ${current_title}
109-
110-
Check Header Environment
111-
[Documentation] Checks the app header against the expected value
112-
[Arguments] ${expected_env}
113-
${current_env} Get Text //div[@id="environment"]
114-
Should Be Equal ${expected_env} ${current_env}
115-
116-
Check Header Color
117-
[Documentation] Checks the app header color against the expected value
118-
[Arguments] ${expected_color}
119-
${class} Get Attribute //div[@id="environment"] class
120-
Should Contain ${class} ${expected_color}
121-
122-
Verify Url Ends With
123-
[Documentation] Checks the apps last url path against the expected path
124-
[Arguments] ${expected_path}
125-
${current_url} Get Url
126-
VAR ${current_path}= ${current_url.split('/')[-1]}
127-
Should Be Equal ${current_path} ${expected_path}
128-
129-
Add Todos To List
130-
[Documentation] Adds a list of todos
131-
[Arguments] @{todos}
132-
FOR ${todo} IN @{todos}
133-
Type Text ${TODO_INPUT} ${todo}
134-
Click ${ADD_BUTTON}
135-
VAR ${TODO_ID} ${${TODO_ID} + 1} scope=SUITE # noqa
136-
END
137-
138-
Verify Todos Exist
139-
[Documentation] Verifies a list of todos exist
140-
[Arguments] @{todos}
141-
Take Screenshot
142-
VAR ${id} ${1}
143-
FOR ${todo} IN @{todos}
144-
${todo_text} Get Text //div[@id="${id}"]//span
145-
Should Be Equal ${todo_text} ${todo}
146-
VAR ${id} ${id + 1}
147-
END
148-
149-
Mark Todos As Done
150-
[Documentation] Marks a list of todos as done
151-
[Arguments] @{todos}
152-
VAR ${id} ${1}
153-
FOR ${todo} IN @{todos} # noqa
154-
Click //div[@id="${id}"]//button[@id="done-todo-button"]
155-
VAR ${id} ${id + 1}
156-
END
157-
158-
Verify Todos Are Done
159-
[Documentation] Verifies a list of todos are done
160-
[Arguments] @{todos}
161-
Click a[href="#/done"]
162-
Take Screenshot
163-
VAR ${id} ${1}
164-
FOR ${todo} IN @{todos}
165-
${done_text} Get Text //div[@id="${id}"]//span
166-
Should Be Equal ${done_text} ${todo}
167-
VAR ${id} ${id + 1}
168-
END
169-
170-
Delete Done Elements
171-
[Documentation] Deletes a list of done elements
172-
[Arguments] @{todos}
173-
VAR ${id} ${1}
174-
FOR ${todo} IN @{todos} # noqa
175-
Click //div[@id="${id}"]//button[@id="done-todo-button"]
176-
VAR ${id} ${id + 1}
177-
END
178-
179-
Verify Elements Are Deleted
180-
[Documentation] Verifies all elements are deleted
181-
[Arguments] @{todos}
182-
Take Screenshot
183-
VAR ${id} ${1}
184-
FOR ${todo} IN @{todos} # noqa
185-
Get Element Count //div[@id="${id}"] == 0
186-
VAR ${id} ${id + 1}
187-
END

0 commit comments

Comments
 (0)