blob: 6217f2a9c393ea77301161fa4097b6516060fb00 [file] [log] [blame]
Ashish Singhac02a0e2020-07-08 13:34:12 +05301*** Settings ***
2Documentation This is the basic test for workflow designer
3Library RequestsLibrary
4Library Collections
5Library SeleniumLibrary
6Resource global_properties.robot
7
8*** Variables ***
9${HOMEPAGE} http://localhost:8285
10${HEADLESS} True
11
12***Keywords***
13
14Open 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
27Setup 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
33Setup 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
41Setup 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
52Input Username
53 [Arguments] ${username}
54 Input Text name=userId ${username}
55
56Input Password
57 [Arguments] ${password}
58 Input Text name=password ${password}
59
60Input Name
61 [Arguments] ${workflowName}
62 Input Text id=workflowName ${workflowName}
63
64Input 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
68Input WFdescription
69 [Arguments] ${description}
70 Input Text xpath=//*[@id="root"]/div[1]/div/div[2]/div[2]/div/div[1]/div/textarea
71
72Submit Login Button
73 Click Element xpath=/html/body/form/input[3]
74
75Submit WorkFlow Button
76 Click Element xpath=/html/body/div/home-page/div/top-nav/nav/ul/li[5]/a
77
78Add 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
82Create Workflow
83 Click Element xpath=/html/body/div[2]/div/div[2]/div/form/div/div[2]/button[1]
84
85Goto Frame
86 Select Frame xpath=/html/body/div/plugin-tab-view/div/plugin-frame/div/div/iframe
87
88Save 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 ***
92Workflow 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