marta 0.31831 → 0.34054

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5194e2abdec5dea63de3729eded639658cd5e4c4
4
- data.tar.gz: 3c246346272294bb585cad04e824ad3f0c271887
3
+ metadata.gz: ebb01908a10c9def323e9ccfb970987b4486be8d
4
+ data.tar.gz: 5d21e110d4e26c82d70c8bc6196a338dd6ae7350
5
5
  SHA512:
6
- metadata.gz: 5afbf7645596d47577731e8e3898e6c2e8a96e575900d0832798cdd0a9ced60430fc70b3afa2e284b1999d721ab150fe7f2e7ac75f4d14c51ec0b57e46b38ca3
7
- data.tar.gz: 860e8de97e4f32469897609fedad639d26864b6503706532f88d2057f122a40bf8d6506f1077adb77ec1f81db00753dde0001fff444a3fab14b1c51379c4f172
6
+ metadata.gz: 201a5d76be951f6d680701686a954cb3ee0001ace4cf051acec597ef25ec936e1df143ff9c4ba53d8486a9ef79200f0ccf9ce5af4c91a61def61c991ce2e4c74
7
+ data.tar.gz: d710edc5c7ac865860ab9e8f4d68ae71c51f39d793ac13401e3257867cbe50312b4684ced457c9fd624b92b5bbe07358c135b07e4366be22b53c43918c5d30c0
data/README.md CHANGED
@@ -39,8 +39,14 @@ your_page.your_element.click
39
39
  4. Take a look at the browser window: Marta will ask you to define Your_Page class. You can add variables for the class there.
40
40
  5. Add *url* variable with the url of desired page as a default value.
41
41
  6. Confirm.
42
+
43
+ ![Steps 4-5-6](readme_files/456steps.png)
44
+
42
45
  7. Then page will be opened and you will be asked about your_element.
43
46
  8. Just click the element and confirm the selection.
47
+
48
+ ![Step 8](readme_files/8step.png)
49
+
44
50
  9. Now you can run the test without LEARN parameter and it will work.
45
51
 
46
52
  **So you are `writing code in pageobject pattern` style.**
@@ -64,11 +70,22 @@ your_page.your_element.click
64
70
 
65
71
  **Q: What if I can locate element only by dynamic attributes like account_id?**
66
72
 
67
- *A: For example you have a pack of html elements with only one attribute that differs: account_id_attribute. First at the stage of page defining create a class variable account_id = "123". After that you can dynamically change it in your code like*
73
+ *A: For example you want to find an element with the dynamic attribute "itemprop"*
74
+
75
+ *First at the stage of page defining create a class variable itemprop = "anything".*
76
+
77
+ ![Dynamic attributes - 1](readme_files/itemprop.png)
78
+
79
+ *After that you can dynamically change it in your code like*
68
80
  ```ruby
69
- your_page.account_id = "456"
81
+ your_page.itemprop # will be "anything" by default
82
+ your_page.itemprop = "about"
70
83
  ```
71
- *And when defining an element you can use it in value field of account_id_attribute like #{@account_id}. See couple examples in example_project (Ruby checkbox, item1 and 2 radio buttons)*
84
+ *And when defining an element you can use it in value field of itemprop like #{@itemprop}.*
85
+
86
+ ![Dynamic attributes - 2](readme_files/itemprop2.png)
87
+
88
+ *See couple examples in example_project (Ruby checkbox, item1 and 2 radio buttons)*
72
89
 
73
90
  **Q: I want to use firefox. How could I?**
74
91
 
@@ -173,6 +190,8 @@ engine.element(id: 'will_be_located_without_Marta')
173
190
 
174
191
  *A: At the stage of element defining you can see a button "Find by HTML". That button will open html code of your page in a special blue form. Find the html code of your element and click on it.*
175
192
 
193
+ ![HTML](readme_files/html.png)
194
+
176
195
  **Q: How can I find not just an element but a Watir::Radio for example?**
177
196
 
178
197
  *A: Marta automatically performs to_subtype for every element. So if your element is a radio button you will be able to use specific methods.*
@@ -208,6 +227,20 @@ your_page.important_element.click
208
227
 
209
228
  *A: You can click 'Set custom xpath' at element defining stage and set own xpath. In that case only that xpath will be used to find element. It is planned to add possibility to set custom css, id, name, etc.*
210
229
 
230
+ ![XPATH](readme_files/xpath.png)
231
+
232
+ **Q: I cannot see the part of my page under marta's form. How to hide it?**
233
+
234
+ *A: Use the hide button*
235
+
236
+ ![Hide](readme_files/hide.png)
237
+
238
+ **Q: At the stage of element defining every click is about selecting element only. Events of the page are not working. What can I do if I want to do some actions at the page before the element selecting?**
239
+
240
+ *A: There is the "Stop watching" button. It will turn Marta's scripts off until the page is reloaded or until user clicks the "Stop watching" button again.*
241
+
242
+ ![Stop watching button](readme_files/stop.png)
243
+
211
244
  **Q: Why Watir? I want to use pure Selenium Webdriver or Capybara or something!**
212
245
 
213
246
  *A: I like Watir. And I have no plans so far to implement something else.*
@@ -216,10 +249,6 @@ your_page.important_element.click
216
249
 
217
250
  *A: Yes it is working with Cucumber and Spinach. I will add some examples later.*
218
251
 
219
- **Q: Where is an example?**
220
-
221
- *A: See "example_project" for rspec based example*
222
-
223
252
  **Q: How can I design more object oriented and DRY tests using Marta**
224
253
 
225
254
  *A: Create wrapping classes. Like*
@@ -247,7 +276,7 @@ g_page.search "I am in love with selenium."
247
276
 
248
277
  **Q: What else?**
249
278
 
250
- *A: Nothing. Marta is under development. Her version is 0.31831 only. And I am not a professional developer. But I am training her on new tricks.*
279
+ *A: Nothing. Marta is under development. Her version is 0.34054 only. And I am not a professional developer. But I am training her on new tricks.*
251
280
 
252
281
  ## Internal Design
253
282
 
@@ -3,10 +3,11 @@
3
3
  <div martaclass=marta_smthing martastyle=header>
4
4
  <h2 id=marta_main_title martaclass=marta_smthing></h2>
5
5
  <div martastyle=icons_holder martaclass=marta_smthing>
6
+ <input type=button martaclass=marta_smthing martastyle=icon_button id=marta_stop value=&#x1f441; />
6
7
  <input type=button martaclass=marta_smthing martastyle=icon_button id=marta_hide value=&#x21E8; />
7
8
  </div>
8
9
  </div>
9
- <div martaclass=marta_smthing martastyle=hint>
10
+ <div martaclass=marta_smthing martastyle=hint id=marta_hint>
10
11
  <p martaclass=marta_smthing>You are about to define some element</p>
11
12
  <p martaclass=marta_smthing>CLICK to select element. Do not worry nothing will work</p>
12
13
  <p martaclass=marta_smthing>After the click select the attributes of an element and parents</p>
@@ -8,6 +8,19 @@ document.getElementById("marta_confirm").onclick = function() {document.marta_en
8
8
  document.getElementById("marta_set_by_hand").onclick = function() {document.marta_set_by_hand()};
9
9
  document.getElementById("marta_show_html").onclick = function() {document.marta_show_html()};
10
10
  document.getElementById("marta_hide").onclick = function() {document.marta_hide()};
11
+ document.getElementById("marta_stop").onclick = function() {document.marta_stop()};
12
+
13
+ document.marta_stop = function() {
14
+ if (document.getElementById("marta_magic_div").getAttribute("martastyle") == "off"){
15
+ document.getElementById("marta_magic_div").setAttribute("martastyle", "at_large");
16
+ document.getElementById("marta_stop").value = String.fromCharCode(55357)+String.fromCharCode(56385);
17
+ document.getElementById("marta_hint").innerHTML = "<p>Marta is watching you</p><p>Please click <b>the correct element</b> only!</p>";
18
+ } else {
19
+ document.getElementById("marta_stop").value = "--";
20
+ document.getElementById("marta_magic_div").setAttribute("martastyle", "off");
21
+ document.getElementById("marta_hint").innerHTML = "<p>Go ahead! Marta is not watching.</p><p>All your actions <b>will not</b> be counted as an element definition</p><p>It will lasts until page will not be refreshed (or new opened).</p><p>Or until you will not switch it off</p>";
22
+ }
23
+ };
11
24
 
12
25
  document.marta_magic_click = function(e) {
13
26
  if (document.marta_test_xx == 0) {var xx = e.clientX} else {var xx = document.marta_test_xx};
@@ -157,6 +157,12 @@ div[martaclass=marta_div] {
157
157
  border: 2px solid black;
158
158
  outline: 2px solid #bbbbbb;
159
159
  background-color: lightgray;
160
+ position : relative;
161
+ z-index : 150000;
162
+ padding: 0;
163
+ margin: 0px 0px 0px 0px;
164
+ overflow-y: scroll;
165
+ max-height: 100%;
160
166
  }
161
167
 
162
168
  div div[martastyle=header] {
@@ -179,6 +185,9 @@ input[martastyle=icon_button] {
179
185
  background-color: lightgrey;
180
186
  border: 1px solid black;
181
187
  visibility: visible;
188
+ width: 30px;
189
+ height: 26px;
190
+ text-align: center;
182
191
  }
183
192
 
184
193
  div[martaclass=marta_div][martastyle=hidden] *:not([martastyle=icon_button]) {
@@ -189,19 +198,13 @@ div[martaclass=marta_div][martastyle=hidden]{
189
198
  height: 0px;
190
199
  outline: none;
191
200
  border: none;
201
+ overflow-y: initial;
192
202
  }
193
203
 
194
204
  h2#marta_main_title {
195
205
  font-size: 20px;
196
206
  }
197
207
 
198
- div[martaclass=marta_div] {
199
- position : relative;
200
- z-index : 150000;
201
- padding: 0;
202
- margin: 0px 0px 0px 0px;
203
- }
204
-
205
208
  div[martastyle=hint] {
206
209
  background-color: #F6F5D7;
207
210
  color: black;
@@ -91,8 +91,10 @@ module Marta
91
91
 
92
92
  # Marta is setting engine by pretty comlex rules
93
93
  def self.set_engine(value)
94
- if (engine.class == Watir::Browser) and (value.class == Watir::Browser)
95
- engine.close
94
+ if (engine.class == Watir::Browser) and
95
+ (value.class == Watir::Browser) and
96
+ (engine != value)
97
+ engine.close if engine.exists?
96
98
  end
97
99
  iframe_locate
98
100
  @@engine = parameter_set(@@engine, value, nil)
data/lib/marta/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Marta
2
- VERSION = "0.31831"
2
+ VERSION = "0.34054"
3
3
  NAME = "marta"
4
4
  end
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marta
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.31831'
4
+ version: '0.34054'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergei Seleznev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-10 00:00:00.000000000 Z
11
+ date: 2017-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -143,6 +143,14 @@ files:
143
143
  - lib/marta/version.rb
144
144
  - lib/marta/x_path.rb
145
145
  - marta.gemspec
146
+ - readme_files/456steps.png
147
+ - readme_files/8step.png
148
+ - readme_files/hide.png
149
+ - readme_files/html.png
150
+ - readme_files/itemprop.png
151
+ - readme_files/itemprop2.png
152
+ - readme_files/stop.png
153
+ - readme_files/xpath.png
146
154
  homepage: https://github.com/sseleznevqa/marta
147
155
  licenses:
148
156
  - MIT