/
TC1_LOGIN.robot
74 lines (63 loc) · 2.25 KB
/
TC1_LOGIN.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
***Settings***
Library SeleniumLibrary
Library ../Resources/Locators.py
Library ../Resources/CustomLib.py
Variables ../Resources/Elements.py
Test Teardown Close Browser window
***Variables***
${url} http://demowebshop.tricentis.com/
${valid_email} randyorton@gmail.com
${valid_password} test2020
${success_msg} Welcome to our store
${unsuccess_msg} The credentials provided are incorrect
${invalid_email} someone@gmail.com
${invalid_password} invalid
***Test Cases***
TestCase1: Login Valid Credentials
[Documentation] Verify valid login to demo web shop
[Tags] integration
Start Browser Window ${url}
Click Login Link
Input Email ${valid_email}
Input Password ${valid_password}
Click Login Button
Welcome Message Validation
TestCase2: Login Invalid Credentials
[Documentation] Verify invalid login to demo web shop
[Tags] integration
Start Browser Window ${url}
Click Login Link
Input Email ${invalid_email}
Input Password ${invalid_password}
Click Login Button
Unsuccessful Login Warning
***Keywords***
Click Login Link
page should contain link ${LoginLink_Loc}
click link ${LoginLink_Loc}
Input Email
[Arguments] ${email}
element should be visible ${Email_Loc}
element should be enabled ${Email_Loc}
input text ${Email_Loc} ${email}
Input Password
[Arguments] ${password}
element should be visible ${Password_Loc}
element should be enabled ${Password_Loc}
input text ${Password_Loc} ${password}
Click Login Button
page should contain button ${LoginButton_Loc}
element should be enabled ${LoginButton_Loc}
click button ${LoginButton_Loc}
Welcome Message Validation
${recieved_msg} get text ${WelcomeMsg_Loc}
element should contain ${WelcomeMsg_Loc} ${success_msg}
should be equal as strings ${success_msg} ${recieved_msg}
log to console ${recieved_msg}
Unsuccessful Login Warning
${recieved_msg} get text ${InvalidMsg_Loc}
element should contain ${InvalidMsg_Loc} ${unsuccess_msg}
should be equal as strings ${unsuccess_msg} ${recieved_msg}
log to console ${recieved_msg}
Close Browser window
close browser