forked from gopal1409/radisysgitlab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.robo
50 lines (44 loc) · 1.79 KB
/
tests.robo
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
47
48
49
50
** Settings ***
Library Collections
Library Process
Library RequestsLibrary
Library SeleniumLibrary
*** Variables ***
${TESTS_DIR} tests
${GITLAB_API_VERSION} v4
${GITLAB_USERNAME} fxs
${GITLAB_NAME} jfxs
${GRID_URL} http://selenium:4444/wd/hub
${BROWSER} Chrome
${RF_SENSITIVE_VARIABLE} ${EMPTY}
*** Test Cases ***
Test Robot Framework: [--version] option
[Tags] core demo
${result} = When Run Process robot --version
Then Should Be Equal As Integers ${result.rc} 251
And Should Contain ${result.stdout} Robot Framework
Test mask sensitive variable:
[Tags] core demo
Log Try to display my sensitive variable: ${RF_SENSITIVE_VARIABLE}
${result} = When Run Process echo ${RF_SENSITIVE_VARIABLE}
Then Should Be Equal As Integers ${result.rc} 0
Test Requests library
[Tags] request demo
Given Create Session gitlab https://gitlab.com disable_warnings=1
${resp}= When Get Request gitlab /api/${GITLAB_API_VERSION}/users?username=${GITLAB_USERNAME}
Then Should Be Equal As Strings ${resp.status_code} 200
${user}= And Get From List ${resp.json()} 0
And Dictionary Should Contain Item ${user} name ${GITLAB_NAME}
Test Selenium library
[Tags] selenium demo
Given Open Browser https://www.google.com ${BROWSER} remote_url=${GRID_URL}
And Set Screenshot Directory EMBED
And Wait Until Page Contains Element name=q
When Input text name=q robot framework
And Wait Until Element Is Enabled name=btnI
And Scroll Element Into View name=btnI
And Click Element name=btnI
Then Wait Until Page Contains Robot Framework
And Capture Page Screenshot
[Teardown] Close All Browsers
*** Keywords ***