leap_salesforce_ui 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -3
- data/.leap_salesforce.yml +1 -0
- data/ChangeLog +4 -0
- data/Rakefile +1 -0
- data/lib/leap_salesforce_ui/create_page.rb +45 -4
- data/lib/leap_salesforce_ui/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49dd5004bf8b345bd392443488da5b806db264a7dd50dd2aa5ab9992d1169028
|
4
|
+
data.tar.gz: a091e11758fafcb039c7cf7bdd1bc06a061d605e742704e8ffc7bd4198a30395
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9462ecb9055aa0d8902096b5b4a2189e8e7fcb3bcd6ed2f25fe252e197d0df6fde9c3436f014f79375850c9fb462b81c62dc5921ef2ccf70f9bafdbf09120a5d
|
7
|
+
data.tar.gz: 076a3803d5be1a35d0da5dc4114482a15f4f6d22f372a2a00a5ca9da0c196f50f5e949e8cf0dfff3007c5e9d2b5f2e4cff7929389e3f039520e69d578246202a
|
data/.gitignore
CHANGED
data/.leap_salesforce.yml
CHANGED
data/ChangeLog
CHANGED
data/Rakefile
CHANGED
@@ -17,16 +17,57 @@ module NewMethods
|
|
17
17
|
@soql_object.accessors[field.to_sym][:label]
|
18
18
|
end
|
19
19
|
|
20
|
+
# @return [Hash] Description of field
|
21
|
+
def field_for(desc)
|
22
|
+
ruby_desc = @soql_object.accessors[desc.to_sym]
|
23
|
+
return ruby_desc if ruby_desc
|
24
|
+
|
25
|
+
@soql_object.properties_for(desc)
|
26
|
+
end
|
27
|
+
|
20
28
|
# Based on data type of field passed, fill in each field
|
21
29
|
# @param [Hash] data
|
22
30
|
def populate_with(data)
|
23
|
-
data.each do |
|
24
|
-
|
25
|
-
|
26
|
-
|
31
|
+
data.each do |desc, value|
|
32
|
+
field = field_for(desc)
|
33
|
+
label_name = field[:label] || field['label']
|
34
|
+
|
35
|
+
type = field[:type] || field['type']
|
36
|
+
case type
|
37
|
+
when 'string'
|
38
|
+
new_panel.text_field(xpath: "//label[contains(.,'#{label_name}')]//following-sibling::input").set value
|
39
|
+
when 'picklist' then set_picklist(label_name, value)
|
40
|
+
when 'textarea'
|
41
|
+
new_panel.textarea(xpath: "//label[contains(.,'#{label_name}')]//following-sibling::textarea").set value
|
42
|
+
when 'reference'
|
43
|
+
set_reference_field(label_name, value)
|
44
|
+
else
|
45
|
+
raise NotImplementedError, "#{type} not yet defined in #{self.class}"
|
46
|
+
end
|
27
47
|
end
|
28
48
|
end
|
29
49
|
|
50
|
+
# Set value of picklist
|
51
|
+
# @param [String] label Label of picklist
|
52
|
+
# @param [String] value Value to set picklist to
|
53
|
+
def set_picklist(label, value)
|
54
|
+
dropdown = new_panel.link(xpath: "//*[./*[text()='#{label}']]//following-sibling::div//a")
|
55
|
+
dropdown.focus
|
56
|
+
sleep 0.5
|
57
|
+
dropdown.click
|
58
|
+
browser.link(xpath: ".//div[contains(@class, 'select-options')]//a[contains(.,'#{value}')]").click
|
59
|
+
end
|
60
|
+
|
61
|
+
def set_reference_field(label, value)
|
62
|
+
ref_label = label.gsub('ID', 'Name')
|
63
|
+
search_val = value[0..12]
|
64
|
+
search_field = browser.text_field(xpath: "//label[contains(.,'#{ref_label}')]//following-sibling::div[1]//input")
|
65
|
+
search_field.set search_val
|
66
|
+
sleep 1.5
|
67
|
+
search_field.send_keys :enter
|
68
|
+
browser.link(xpath: "//div[contains(@class,'searchScroller')]//a[contains(.,'#{search_val}')]").click
|
69
|
+
end
|
70
|
+
|
30
71
|
def submit_with(data)
|
31
72
|
populate_with data
|
32
73
|
save
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: leap_salesforce_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- IQA
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-01-
|
12
|
+
date: 2021-01-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: leap_salesforce
|