sunomono 1.0.4 → 1.0.5

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: e78bd6d08bbd1eb3a9d57309b2e4a695e8cae07d
4
- data.tar.gz: be49f6d3a87b3f5b634082fe1862aca2c2a25a3f
3
+ metadata.gz: 35e12361309a724a9e8cdbe33731a23c7756930a
4
+ data.tar.gz: eab5a76b1a76a801a3bb11ef5f64b82b4661a792
5
5
  SHA512:
6
- metadata.gz: 0a3cb49c5508d42ab7fada0432a22e4f790cded0269fec966f3468c228be6194a18f9c055955d5517d1370e6483a1201480ed50cfc9838d42ea0d7dc1463b39f
7
- data.tar.gz: 9194214f8ad6c50bee9c94d58bfe762c096f555355b5e68f4ec693e9995e109a6e7c58e7c836a97e0578aa1962609517c21440805ede66fa00d493ee55bb3d00
6
+ metadata.gz: 143539f7426d7838ab4425a64b906e435f074ad9fceff2a72a3b4629d88b49aeadc5f91bc1ce6473c9e1cd77294c89fb72c81960f79aa7107b2cccb49e870a02
7
+ data.tar.gz: 277d9679e19b4e4393ed7863f69c399b2b116d498d3be81ebcba484008168d47b34feaee464807dee41d856f5ca37fcd568f26a086891f0146db2bad3e86b8ab
data/SUNOMONO_APPIUM.md CHANGED
@@ -10,6 +10,25 @@ The project structure is based on this [project](https://github.com/gricsi/cross
10
10
  3. Screens: Contains all the Android and iOS screens. A screen must contain an identification, the declaration of all the elements of the screen and the declaration of its actions. This layer is Platform dependent. This occurs because, in almost every project, the identification of the elements varies between the Platforms. One example is that in Android almost all elements have an id, but in iOS the most common is to identify the elements by accessibility label. The Platform dependent screens must have the same name and same methods signatures. This will allow your steps to be unique between platforms
11
11
  4. Modules: Contains all the methods commons between the features e.g(LoginScreen(android) and LoginScreen(ios) contains the elements of the screens and different methods and interaction between platforms), the module contains the method with the same behavior on platforms
12
12
 
13
+
14
+ ## Getting started
15
+
16
+ ### Running arc console
17
+
18
+ To run the arc console you need to run this following command on terminal:
19
+
20
+ Android
21
+
22
+ ```
23
+ bundle exec arc toml 'something/project/features/support/android/appium.txt'
24
+ ```
25
+
26
+ iOS
27
+
28
+ ```
29
+ bundle exec arc toml 'something/project/features/support/ios/appium.txt'
30
+ ```
31
+
13
32
  ## Appium server
14
33
 
15
34
  RakeFile contains any tips to start the appium server and run your tests
@@ -1,3 +1,3 @@
1
1
  module Sunomono
2
- VERSION = '1.0.4'.freeze
2
+ VERSION = '1.0.5'.freeze
3
3
  end
@@ -11,9 +11,55 @@ class BaseScreen
11
11
  alias_method :trait, :identificator
12
12
  end
13
13
 
14
- def check_trait(timeout = 10)
14
+ def method_missing(method, *args)
15
+ if method.to_s.start_with?('touch_')
16
+ wait_element_for_touch public_send(method.to_s.sub('touch_', ''))
17
+
18
+ elsif method.to_s.start_with?('enter_')
19
+ enter args[0], public_send(method.to_s.sub('enter_', ''))
20
+
21
+ elsif method.to_s.end_with?('_displayed?')
22
+ element_displayed? public_send(method.to_s.sub('_displayed?', ''))
23
+ else
24
+ super
25
+ end
26
+ end
27
+
28
+ # This method has been necessary, because the method_missing has overriding
29
+ def respond_to_missing?
30
+ true
31
+ end
32
+
33
+ def check_trait(timeout = 10)
15
34
  raise ElementNotFoundError,
16
35
  "#{trait} not found" unless
17
36
  wait_true(timeout) { find_element(:id, trait).displayed? }
37
+ end
38
+
39
+ def enter(text, element)
40
+ wait = Selenium::WebDriver::Wait.new timeout: 30
41
+ begin
42
+ wait.until { find_element(:id, element).send_keys text }
43
+ rescue Selenium::WebDriver::Error::TimeOutError => e
44
+ raise "Problem on send keys to element #{element} \n Error: #{e.message}"
45
+ end
46
+ end
47
+
48
+ def element_displayed?(element)
49
+ wait = Selenium::WebDriver::Wait.new timeout: 30
50
+ begin
51
+ wait.until { find_element(:id, element).displayed? }
52
+ rescue Selenium::WebDriver::Error::TimeOutError => e
53
+ raise "Element #{element} not visible \n Error: #{e.message}"
54
+ end
55
+ end
56
+
57
+ def wait_element_for_touch(element)
58
+ wait = Selenium::WebDriver::Wait.new timeout: 30
59
+ begin
60
+ wait.until { find_element(:id, element).click }
61
+ rescue Selenium::WebDriver::Error::TimeOutError => e
62
+ raise "Problem on touch the element #{element} \n Error: #{e.message}"
63
+ end
18
64
  end
19
65
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sunomono
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Tanner
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-11-13 00:00:00.000000000 Z
12
+ date: 2018-01-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler