Add new fields to config file in slice-analysis and remove unused files
[integration/csit.git] / tests / sdc-workflow-d / test1.robot
1 *** Settings ***
2 Documentation         This is the basic test for workflow designer
3 Library           RequestsLibrary
4 Library           Collections
5 Library           SeleniumLibrary
6 Resource          global_properties.robot
7
8 *** Variables ***
9 ${HOMEPAGE}     http://localhost:8285
10 ${HEADLESS}     True
11
12 ***Keywords***
13
14 Open SDC GUI
15     [Documentation]   Logs in to SDC GUI
16     [Arguments]    ${PATH}
17     ## Setup Browever now being managed by the test case
18     ##Setup Browser
19     Go To    ${HOMEPAGE}${PATH}
20     Maximize Browser Window
21
22     # Set Browser Implicit Wait    ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
23     # Log    Logging in to ${SDC_FE_ENDPOINT}${PATH}
24     Wait Until Page Contains    Jimmy
25     # Log    Logged in to ${SDC_FE_ENDPOINT}${PATH}
26
27 Setup Browser
28     [Documentation]   Sets up browser based upon the value of ${GLOBAL_SELENIUM_BROWSER}
29     Run Keyword If    '${GLOBAL_SELENIUM_BROWSER}' == 'firefox'    Setup Browser Firefox
30     Run Keyword If    '${GLOBAL_SELENIUM_BROWSER}' == 'chrome'    Setup Browser Chrome
31     Log    Running with ${GLOBAL_SELENIUM_BROWSER}
32
33 Setup Browser Firefox
34     ${caps}=   Evaluate   sys.modules['selenium.webdriver'].common.desired_capabilities.DesiredCapabilities.FIREFOX   sys
35     Set To Dictionary   ${caps}   marionette=
36     Set To Dictionary   ${caps}   elementScrollBehavior    1
37     ${wd}=   Create WebDriver   Firefox   capabilities=${caps}
38     Set Global Variable    ${GLOBAL_SELENIUM_BROWSER_CAPABILITIES}    ${caps}
39
40
41 Setup Browser Chrome
42     ${chrome options}=    Evaluate    sys.modules['selenium.webdriver'].ChromeOptions()    sys
43     Call Method    ${chrome options}    add_argument    no-sandbox
44     Call Method    ${chrome options}    add_argument    ignore-certificate-errors
45     Run Keyword If  ${HEADLESS}==True  Call Method    ${chrome options}    add_argument    headless
46     ${dc}   Evaluate    sys.modules['selenium.webdriver'].DesiredCapabilities.CHROME  sys, selenium.webdriver
47     Set To Dictionary   ${dc}   elementScrollBehavior    1
48     Set To Dictionary   ${dc}   ACCEPT_SSL_CERTS    True
49     Create Webdriver    Chrome   chrome_options=${chrome_options}    desired_capabilities=${dc}
50     Set Global Variable    ${GLOBAL_SELENIUM_BROWSER_CAPABILITIES}    ${dc}
51
52 Input Username
53     [Arguments]       ${username}
54     Input Text        name=userId    ${username}
55
56 Input Password
57     [Arguments]       ${password}
58     Input Text        name=password    ${password}
59
60 Input Name
61     [Arguments]       ${workflowName}
62     Input Text        id=workflowName    ${workflowName}
63
64 Input Description
65     [Arguments]       ${description}
66     Input Text        xpath=/html/body/div[2]/div/div[2]/div/form/div/div[1]/div[2]/div/textarea    ${description}
67
68 Input WFdescription
69     [Arguments]       ${description}
70     Input Text        xpath=//*[@id="root"]/div[1]/div/div[2]/div[2]/div/div[1]/div/textarea
71
72 Submit Login Button
73     Click Element     xpath=/html/body/form/input[3]
74
75 Submit WorkFlow Button
76     Click Element     xpath=/html/body/div/home-page/div/top-nav/nav/ul/li[5]/a
77
78 Add WorkFlow
79     Click Element     xpath=//*[@id="root"]/div[1]/div/div[2]/div/div[2]/div[1]
80     # Click Element     xpath=//*[@id="root"]/div[1]/div/div[2]/div/div[2]/div[1]/div[1]/div/svg
81
82 Create Workflow
83     Click Element     xpath=/html/body/div[2]/div/div[2]/div/form/div/div[2]/button[1]
84
85 Goto Frame
86     Select Frame      xpath=/html/body/div/plugin-tab-view/div/plugin-frame/div/div/iframe
87
88 Save WorkFlow
89     Click Element     xpath=//*[@id="root"]/div[1]/div/div[1]/div[2]/div[2]/div/div/div[2]/div/div/span   
90
91 *** Test Cases ***
92 Workflow Designer Testing
93     [Documentation]            User can homepage and see the tag line
94     Setup Browser
95     Open SDC GUI     /login
96     Input Username   cs0008
97     Input Password  123123a
98     Submit Login Button
99     Wait Until Page Contains    WORKFLOW
100     Submit WorkFlow Button
101     BuiltIn.Sleep  5s
102     Goto Frame
103     Add WorkFlow
104     BuiltIn.Sleep  5s
105     Input Name  testing7
106     Input Description  first test through selenium
107     Create Workflow
108     # Wait Until Page Contains    General
109     # Input Description2  write some dummy description
110     # Save WorkFlow
111     # BuiltIn.Sleep  5s
112     Close Browser