robotest 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,131 @@
1
+ # to require all the related gems and functionalities to this spec we need to give this in every spec file.
2
+ require 'spec_helper'
3
+
4
+ # Give a unique name in describe so that allure report will be created seperately.
5
+ # Note: If two spec has same name, allure will override the results of first spec with the second spec which has same name.
6
+ describe "Test Spec" do
7
+
8
+ before(:all) do
9
+ # Initialize all the constants here.
10
+
11
+ # Initialize a driver with a name, so that when there is a bug screen shots will be saved with the name.
12
+ # Multiple drivers can be initialized (with different properties, check driver.rb file in the gem for details)
13
+ # We can initialize one chrome, one firefox, one explorer, one safari browser at a time.
14
+ @driver1 = Driver.new("Test_Driver_1")
15
+ @driver2 = Driver.new("Test_Driver_2")
16
+ @driver3 = Driver.new("Test_Driver_3")
17
+ @driver4 = Driver.new("Test_Driver_4")
18
+
19
+ # To load the constants file from Constants class.
20
+ @constants = Constants.new
21
+
22
+ # Initialize the page class with the driver.
23
+ # Each instance method will be corresponding to the driver with which it is declared.
24
+ # New pages can be added and used in the same way
25
+ @driver1_login_page = Pages::TestPage.new(@driver1)
26
+ @driver2_login_page = Pages::TestPage.new(@driver2)
27
+ @driver3_login_page = Pages::TestPage.new(@driver3)
28
+ @driver4_login_page = Pages::TestPage.new(@driver4)
29
+
30
+ end
31
+
32
+ before(:each) do
33
+ # any specfic steps that needs to be done before each testcase can be done here
34
+ # Example : Moving to the home page after all the test case will be an idle one.
35
+ end
36
+
37
+ after(:all) do
38
+ # Steps that is to be run after all the test cases are done can be given here.
39
+ # Usual steps will be quiting all the drivers, but that is handled in the spec_helper.rb so any other specific steps other than quit can be given here.
40
+ end
41
+
42
+ after(:each) do |e|
43
+ # any specfic steps that needs to be done after each testcase can be done here
44
+ # Usually taking screen shots after each test case when there is a failure is done here, but that is covered in spec_helper.rb
45
+ # Any other steps than taking screenshot can be given here.
46
+ end
47
+
48
+
49
+ # Each test case can be declared with `it`
50
+ # after the test case name is defined we can define the tags for that test case
51
+ # These tags can be used to run only critical test cases, only sanity test cases or we can use the testId for any custom reporting.
52
+ it 'this test will pass',:severity => "critical", :sanity => true, :testId => '001' do |e|
53
+ # for more help on rspec expect statements you can visit the following website
54
+ # https://relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
55
+
56
+ # e.step is used by allure for reporting purpose. It is best to have all the lines inside any one of the e.step so that we can have a detailed reporting
57
+ e.step "true eql true" do
58
+ expect(true).to eq true
59
+ end
60
+ e.step "false eql false" do
61
+ expect(false).to eq false
62
+ end
63
+ e.step "string eql string" do
64
+ expect("test").to eq "test"
65
+ end
66
+ e.step "number eql number" do
67
+ expect(1).to eq 1
68
+ end
69
+ end
70
+
71
+ it "this test will fail", :severity => "critical", :testId => '002' do |e|
72
+ e.step "true eql true" do
73
+ expect(true).to eq true
74
+ end
75
+ e.step "false eql false" do
76
+ expect(false).to eq false
77
+ end
78
+ # Test case will fail in the below step
79
+ e.step "true eql false" do
80
+ expect(true).to eq false
81
+ end
82
+ # Since the above step is failed, following steps will not be executed.
83
+ e.step "true eql true" do
84
+ expect(true).to eq true
85
+ end
86
+ e.step "false eql false" do
87
+ expect(false).to eq false
88
+ end
89
+ end
90
+
91
+ it "this test will fail", :severity => "critical", :testId => '003' do |e|
92
+ e.step "true eql true" do
93
+ expect(true).to eq true
94
+ end
95
+ e.step "false eql false" do
96
+ expect(false).to eq false
97
+ end
98
+ # Test case will fail in the below step
99
+ # cstep is the custom method in which if a step fails it wont stop the test case
100
+ # this cstep can be used to validate data in a page, if we need to test and report 10 variables in a page, then we can use this so that all the validation point steps even if one step is failed
101
+ e.cstep "1 equal 2" do
102
+ expect(1).to eq 2
103
+ end
104
+ # even if the the above step is failed, following steps will be executed.
105
+ e.step "true eql true" do
106
+ expect(true).to eq true
107
+ end
108
+ e.step "false eql false" do
109
+ expect(false).to eq false
110
+ end
111
+ end
112
+
113
+
114
+ it 'Calling a function in a `Page` and `Object` from the spec file',:severity => "critical", :testId => '004' do |e|
115
+ # we can call a funtion in the pages in the following ways
116
+ e.step "Login to the application" do
117
+ @driver1_login_page.login(@constants.COMMON_EMAIL, @constants.COMMON_PASSWORD, @constants.BASE_URL)
118
+ Pages::TestPage.new(@driver2).login(@constants.COMMON_EMAIL, @constants.COMMON_PASSWORD, @constants.BASE_URL)
119
+ end
120
+
121
+ # we can call a locator with the page instance itself as follows,
122
+ e.step "Is login link is present" do
123
+ expect(@driver1_login_page.LOGIN_LINK.is_present?).to eql false
124
+ expect(@driver1_login_page.LOGIN_DYNAMIC("Login").is_present?).to eql false
125
+ end
126
+
127
+ end
128
+
129
+
130
+
131
+ end
@@ -0,0 +1,131 @@
1
+ # to require all the related gems and functionalities to this spec we need to give this in every spec file.
2
+ require 'spec_helper'
3
+
4
+ # Give a unique name in describe so that allure report will be created seperately.
5
+ # Note: If two spec has same name, allure will override the results of first spec with the second spec which has same name.
6
+ describe "Test Spec" do
7
+
8
+ before(:all) do
9
+ # Initialize all the constants here.
10
+
11
+ # Initialize a driver with a name, so that when there is a bug screen shots will be saved with the name.
12
+ # Multiple drivers can be initialized (with different properties, check driver.rb file in the gem for details)
13
+ # We can initialize one chrome, one firefox, one explorer, one safari browser at a time.
14
+ @driver1 = Driver.new("Test_Driver_1")
15
+ @driver2 = Driver.new("Test_Driver_2")
16
+ @driver3 = Driver.new("Test_Driver_3")
17
+ @driver4 = Driver.new("Test_Driver_4")
18
+
19
+ # To load the constants file from Constants class.
20
+ @constants = Constants.new
21
+
22
+ # Initialize the page class with the driver.
23
+ # Each instance method will be corresponding to the driver with which it is declared.
24
+ # New pages can be added and used in the same way
25
+ @driver1_login_page = Pages::TestPage.new(@driver1)
26
+ @driver2_login_page = Pages::TestPage.new(@driver2)
27
+ @driver3_login_page = Pages::TestPage.new(@driver3)
28
+ @driver4_login_page = Pages::TestPage.new(@driver4)
29
+
30
+ end
31
+
32
+ before(:each) do
33
+ # any specfic steps that needs to be done before each testcase can be done here
34
+ # Example : Moving to the home page after all the test case will be an idle one.
35
+ end
36
+
37
+ after(:all) do
38
+ # Steps that is to be run after all the test cases are done can be given here.
39
+ # Usual steps will be quiting all the drivers, but that is handled in the spec_helper.rb so any other specific steps other than quit can be given here.
40
+ end
41
+
42
+ after(:each) do |e|
43
+ # any specfic steps that needs to be done after each testcase can be done here
44
+ # Usually taking screen shots after each test case when there is a failure is done here, but that is covered in spec_helper.rb
45
+ # Any other steps than taking screenshot can be given here.
46
+ end
47
+
48
+
49
+ # Each test case can be declared with `it`
50
+ # after the test case name is defined we can define the tags for that test case
51
+ # These tags can be used to run only critical test cases, only sanity test cases or we can use the testId for any custom reporting.
52
+ it 'this test will pass',:severity => "critical", :sanity => true, :testId => '001' do |e|
53
+ # for more help on rspec expect statements you can visit the following website
54
+ # https://relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
55
+
56
+ # e.step is used by allure for reporting purpose. It is best to have all the lines inside any one of the e.step so that we can have a detailed reporting
57
+ e.step "true eql true" do
58
+ expect(true).to eq true
59
+ end
60
+ e.step "false eql false" do
61
+ expect(false).to eq false
62
+ end
63
+ e.step "string eql string" do
64
+ expect("test").to eq "test"
65
+ end
66
+ e.step "number eql number" do
67
+ expect(1).to eq 1
68
+ end
69
+ end
70
+
71
+ it "this test will fail", :severity => "critical", :testId => '002' do |e|
72
+ e.step "true eql true" do
73
+ expect(true).to eq true
74
+ end
75
+ e.step "false eql false" do
76
+ expect(false).to eq false
77
+ end
78
+ # Test case will fail in the below step
79
+ e.step "true eql false" do
80
+ expect(true).to eq false
81
+ end
82
+ # Since the above step is failed, following steps will not be executed.
83
+ e.step "true eql true" do
84
+ expect(true).to eq true
85
+ end
86
+ e.step "false eql false" do
87
+ expect(false).to eq false
88
+ end
89
+ end
90
+
91
+ it "this test will fail", :severity => "critical", :testId => '003' do |e|
92
+ e.step "true eql true" do
93
+ expect(true).to eq true
94
+ end
95
+ e.step "false eql false" do
96
+ expect(false).to eq false
97
+ end
98
+ # Test case will fail in the below step
99
+ # cstep is the custom method in which if a step fails it wont stop the test case
100
+ # this cstep can be used to validate data in a page, if we need to test and report 10 variables in a page, then we can use this so that all the validation point steps even if one step is failed
101
+ e.cstep "1 equal 2" do
102
+ expect(1).to eq 2
103
+ end
104
+ # even if the the above step is failed, following steps will be executed.
105
+ e.step "true eql true" do
106
+ expect(true).to eq true
107
+ end
108
+ e.step "false eql false" do
109
+ expect(false).to eq false
110
+ end
111
+ end
112
+
113
+
114
+ it 'Calling a function in a `Page` and `Object` from the spec file',:severity => "critical", :testId => '004' do |e|
115
+ # we can call a funtion in the pages in the following ways
116
+ e.step "Login to the application" do
117
+ @driver1_login_page.login(@constants.COMMON_EMAIL, @constants.COMMON_PASSWORD, @constants.BASE_URL)
118
+ Pages::TestPage.new(@driver2).login(@constants.COMMON_EMAIL, @constants.COMMON_PASSWORD, @constants.BASE_URL)
119
+ end
120
+
121
+ # we can call a locator with the page instance itself as follows,
122
+ e.step "Is login link is present" do
123
+ expect(@driver1_login_page.LOGIN_LINK.is_present?).to eql false
124
+ expect(@driver1_login_page.LOGIN_DYNAMIC("Login").is_present?).to eql false
125
+ end
126
+
127
+ end
128
+
129
+
130
+
131
+ end
@@ -0,0 +1,131 @@
1
+ # to require all the related gems and functionalities to this spec we need to give this in every spec file.
2
+ require 'spec_helper'
3
+
4
+ # Give a unique name in describe so that allure report will be created seperately.
5
+ # Note: If two spec has same name, allure will override the results of first spec with the second spec which has same name.
6
+ describe "Test Spec" do
7
+
8
+ before(:all) do
9
+ # Initialize all the constants here.
10
+
11
+ # Initialize a driver with a name, so that when there is a bug screen shots will be saved with the name.
12
+ # Multiple drivers can be initialized (with different properties, check driver.rb file in the gem for details)
13
+ # We can initialize one chrome, one firefox, one explorer, one safari browser at a time.
14
+ @driver1 = Driver.new("Test_Driver_1")
15
+ @driver2 = Driver.new("Test_Driver_2")
16
+ @driver3 = Driver.new("Test_Driver_3")
17
+ @driver4 = Driver.new("Test_Driver_4")
18
+
19
+ # To load the constants file from Constants class.
20
+ @constants = Constants.new
21
+
22
+ # Initialize the page class with the driver.
23
+ # Each instance method will be corresponding to the driver with which it is declared.
24
+ # New pages can be added and used in the same way
25
+ @driver1_login_page = Pages::TestPage.new(@driver1)
26
+ @driver2_login_page = Pages::TestPage.new(@driver2)
27
+ @driver3_login_page = Pages::TestPage.new(@driver3)
28
+ @driver4_login_page = Pages::TestPage.new(@driver4)
29
+
30
+ end
31
+
32
+ before(:each) do
33
+ # any specfic steps that needs to be done before each testcase can be done here
34
+ # Example : Moving to the home page after all the test case will be an idle one.
35
+ end
36
+
37
+ after(:all) do
38
+ # Steps that is to be run after all the test cases are done can be given here.
39
+ # Usual steps will be quiting all the drivers, but that is handled in the spec_helper.rb so any other specific steps other than quit can be given here.
40
+ end
41
+
42
+ after(:each) do |e|
43
+ # any specfic steps that needs to be done after each testcase can be done here
44
+ # Usually taking screen shots after each test case when there is a failure is done here, but that is covered in spec_helper.rb
45
+ # Any other steps than taking screenshot can be given here.
46
+ end
47
+
48
+
49
+ # Each test case can be declared with `it`
50
+ # after the test case name is defined we can define the tags for that test case
51
+ # These tags can be used to run only critical test cases, only sanity test cases or we can use the testId for any custom reporting.
52
+ it 'this test will pass',:severity => "critical", :sanity => true, :testId => '001' do |e|
53
+ # for more help on rspec expect statements you can visit the following website
54
+ # https://relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
55
+
56
+ # e.step is used by allure for reporting purpose. It is best to have all the lines inside any one of the e.step so that we can have a detailed reporting
57
+ e.step "true eql true" do
58
+ expect(true).to eq true
59
+ end
60
+ e.step "false eql false" do
61
+ expect(false).to eq false
62
+ end
63
+ e.step "string eql string" do
64
+ expect("test").to eq "test"
65
+ end
66
+ e.step "number eql number" do
67
+ expect(1).to eq 1
68
+ end
69
+ end
70
+
71
+ it "this test will fail", :severity => "critical", :testId => '002' do |e|
72
+ e.step "true eql true" do
73
+ expect(true).to eq true
74
+ end
75
+ e.step "false eql false" do
76
+ expect(false).to eq false
77
+ end
78
+ # Test case will fail in the below step
79
+ e.step "true eql false" do
80
+ expect(true).to eq false
81
+ end
82
+ # Since the above step is failed, following steps will not be executed.
83
+ e.step "true eql true" do
84
+ expect(true).to eq true
85
+ end
86
+ e.step "false eql false" do
87
+ expect(false).to eq false
88
+ end
89
+ end
90
+
91
+ it "this test will fail", :severity => "critical", :testId => '003' do |e|
92
+ e.step "true eql true" do
93
+ expect(true).to eq true
94
+ end
95
+ e.step "false eql false" do
96
+ expect(false).to eq false
97
+ end
98
+ # Test case will fail in the below step
99
+ # cstep is the custom method in which if a step fails it wont stop the test case
100
+ # this cstep can be used to validate data in a page, if we need to test and report 10 variables in a page, then we can use this so that all the validation point steps even if one step is failed
101
+ e.cstep "1 equal 2" do
102
+ expect(1).to eq 2
103
+ end
104
+ # even if the the above step is failed, following steps will be executed.
105
+ e.step "true eql true" do
106
+ expect(true).to eq true
107
+ end
108
+ e.step "false eql false" do
109
+ expect(false).to eq false
110
+ end
111
+ end
112
+
113
+
114
+ it 'Calling a function in a `Page` and `Object` from the spec file',:severity => "critical", :testId => '004' do |e|
115
+ # we can call a funtion in the pages in the following ways
116
+ e.step "Login to the application" do
117
+ @driver1_login_page.login(@constants.COMMON_EMAIL, @constants.COMMON_PASSWORD, @constants.BASE_URL)
118
+ Pages::TestPage.new(@driver2).login(@constants.COMMON_EMAIL, @constants.COMMON_PASSWORD, @constants.BASE_URL)
119
+ end
120
+
121
+ # we can call a locator with the page instance itself as follows,
122
+ e.step "Is login link is present" do
123
+ expect(@driver1_login_page.LOGIN_LINK.is_present?).to eql false
124
+ expect(@driver1_login_page.LOGIN_DYNAMIC("Login").is_present?).to eql false
125
+ end
126
+
127
+ end
128
+
129
+
130
+
131
+ end
@@ -0,0 +1,2 @@
1
+ common_email = "test@gmail.com"
2
+ common_password = "test"
@@ -0,0 +1,38 @@
1
+ browser: chrome
2
+ mode: parallel
3
+
4
+ switches:
5
+ - disable-infobars
6
+ - headless
7
+ - disable-gpu
8
+ - disable-dev-shm-usage
9
+ - no-sandbox
10
+ - screen-size=1200x800
11
+
12
+ dimensions:
13
+ horizontal: 1366
14
+ vertical: 768
15
+
16
+ reports:
17
+ html: reports/html_report.html
18
+ RspecJunitFormatter: reports/junit_report.xml
19
+ doc: console
20
+
21
+ screenshot_location: reports/screenshots
22
+
23
+ implicit_wait: 20
24
+
25
+ prefs:
26
+ credentials_enable_service: false
27
+ profile:
28
+ password_manager_enabled: false
29
+ download:
30
+ default_directory: downloads/
31
+ browser:
32
+ set_download_behavior: { behavior: "allow" }
33
+
34
+ specs:
35
+ - spec/test_spec.rb
36
+
37
+ base_urls:
38
+ - https://www.google.com
@@ -0,0 +1,45 @@
1
+ browser: chrome
2
+ mode: parallel
3
+
4
+ switches:
5
+ - disable-infobars
6
+ - headless
7
+ - disable-gpu
8
+ - disable-dev-shm-usage
9
+ - no-sandbox
10
+ - screen-size=1200x800
11
+
12
+ dimensions:
13
+ horizontal: 1366
14
+ vertical: 768
15
+
16
+ reports:
17
+ html: reports/html_report.html
18
+ RspecJunitFormatter: reports/junit_report.xml
19
+ doc: console
20
+
21
+ screenshot_location: reports/screenshots
22
+
23
+ implicit_wait: 20
24
+
25
+ prefs:
26
+ credentials_enable_service: false
27
+ profile:
28
+ password_manager_enabled: false
29
+ download:
30
+ default_directory: downloads/
31
+ browser:
32
+ set_download_behavior: { behavior: "allow" }
33
+
34
+ specs:
35
+ - spec/test_spec.rb
36
+ - spec/test_spec_copy.rb
37
+ - spec/test_spec_copy_2.rb
38
+ - spec/test_spec_copy_3.rb
39
+
40
+ # number of base url's is equal to the number of process that will be initiated during the run
41
+ # when more than one URL is given parallel_process should not be given. When single url is being used then parallel_process can be used.
42
+ base_urls:
43
+ - https://www.google.com
44
+
45
+ parallel_process: 4