nab_com_au 0.3.0 → 0.4.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG +16 -0
- data/lib/NabComAu/Account.rb +17 -3
- data/lib/NabComAu/Bpay.rb +0 -13
- data/lib/NabComAu/VERSION.rb +1 -1
- data/nab_com_au.gemspec +1 -1
- data/test/NabComAu/Account_test.rb +10 -4
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 88a93b5059683cf91e4d39ec681e1b50024be3f891d4058c8fe91b91a762c89f
|
|
4
|
+
data.tar.gz: 21464a03c7c7409e456c764abc6fe3d242396ff2ecc740934f80a06e594db744
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6f14c5e6c6c6d2464ccbeb122ac7029537934612430b340066d412d278fb928dd1c5a123567e90ca612d609988fc2283ddd00f68d3031002925eaf5953c2d8b4
|
|
7
|
+
data.tar.gz: 53d2b691ac7785097114a952025594b546571f4de41e3a0b19208ab9a523264f36363ccac73d923747fd52e67392f6e99b56b70895ad09e2e72f183fb7317ea1
|
data/CHANGELOG
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
## 20261115
|
|
4
4
|
|
|
5
|
+
0.4.0: ~ NabComAu::Account::PAGE_SELECTORS: /logged_out_xpath/logged_out_selector/, NAB's logged-out notice, upon webaccount 0.9.
|
|
6
|
+
|
|
7
|
+
1. ~ NabComAu::Account::PAGE_SELECTORS: logged_out_xpath: '' is replaced by logged_out_selector:, matching NAB's "You have been successfully logged out." notice.
|
|
8
|
+
2. ~ nab_com_au.gemspec: webaccount /'~> 0.8'/'~> 0.9'/
|
|
9
|
+
3. ~ test/NabComAu/Account_test.rb: The logged-out selector is tested.
|
|
10
|
+
4. ~ NabComAu::VERSION: /0.3.1/0.4.0/
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
0.3.1: ~ NabComAu::Account#login: Names every missing argument at once, by validate_args().
|
|
14
|
+
|
|
15
|
+
1. ~ NabComAu::Account#login: validate_args(username:, password:), in place of raising upon each in turn.
|
|
16
|
+
2. + NabComAu::Account#validate_args, moved from NabComAu::Bpay, which inherits it.
|
|
17
|
+
3. ~ test/NabComAu/Account_test.rb: The messages for username or password missing, and for both, are tested.
|
|
18
|
+
4. ~ NabComAu::VERSION: /0.3.0/0.3.1/
|
|
19
|
+
|
|
20
|
+
|
|
5
21
|
0.3.0: - NabComAu::Account#initialize: Now uses superclass WebAccount; + nab_com_au.gemspec.
|
|
6
22
|
|
|
7
23
|
1. - NabComAu::Account#initialize, WebAccount's taking the browser's options, such as browser:, profile_directory: and headless:, and reading PAGE_SELECTORS itself.
|
data/lib/NabComAu/Account.rb
CHANGED
|
@@ -19,15 +19,16 @@ module NabComAu
|
|
|
19
19
|
login_page_password_field_selector: {id: 'password'},
|
|
20
20
|
login_page_submit_button_selector: {xpath: "//button[contains(text(), 'Login')]"},
|
|
21
21
|
logout_button_selector: {id: 'logoutButton'},
|
|
22
|
-
|
|
22
|
+
logged_out_selector: {xpath: "//*[contains(text(), 'You have been successfully logged out.')]"}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
attr_writer :driver
|
|
26
26
|
|
|
27
27
|
def login(username: nil, password: nil)
|
|
28
28
|
@logged_in = false
|
|
29
|
-
username ||= self.username
|
|
30
|
-
password ||= self.password
|
|
29
|
+
username ||= self.username
|
|
30
|
+
password ||= self.password
|
|
31
|
+
validate_args(username: username, password: password)
|
|
31
32
|
driver.attempt do
|
|
32
33
|
get_login_page
|
|
33
34
|
sleep 1
|
|
@@ -61,5 +62,18 @@ module NabComAu
|
|
|
61
62
|
transfer.driver = driver
|
|
62
63
|
transfer.pay
|
|
63
64
|
end
|
|
65
|
+
|
|
66
|
+
private
|
|
67
|
+
|
|
68
|
+
def validate_args(args)
|
|
69
|
+
missing_args = []
|
|
70
|
+
args.each do |arg_name, value|
|
|
71
|
+
missing_args << arg_name unless value
|
|
72
|
+
end
|
|
73
|
+
return if missing_args.empty?
|
|
74
|
+
aggregate_error = missing_args.join(', ')
|
|
75
|
+
copula = missing_args.count > 1 ? 'are' : 'is'
|
|
76
|
+
raise ArgumentError, "#{aggregate_error} #{copula} missing."
|
|
77
|
+
end
|
|
64
78
|
end
|
|
65
79
|
end
|
data/lib/NabComAu/Bpay.rb
CHANGED
|
@@ -205,18 +205,5 @@ module NabComAu
|
|
|
205
205
|
new_bill_payment_confirmation(password: password)
|
|
206
206
|
sleep 1
|
|
207
207
|
end
|
|
208
|
-
|
|
209
|
-
private
|
|
210
|
-
|
|
211
|
-
def validate_args(args)
|
|
212
|
-
missing_args = []
|
|
213
|
-
args.each do |arg_name, value|
|
|
214
|
-
missing_args << arg_name unless value
|
|
215
|
-
end
|
|
216
|
-
return if missing_args.empty?
|
|
217
|
-
aggregate_error = missing_args.join(', ')
|
|
218
|
-
copula = missing_args.count > 1 ? 'are' : 'is'
|
|
219
|
-
raise ArgumentError, "#{aggregate_error} #{copula} missing."
|
|
220
|
-
end
|
|
221
208
|
end
|
|
222
209
|
end
|
data/lib/NabComAu/VERSION.rb
CHANGED
data/nab_com_au.gemspec
CHANGED
|
@@ -31,6 +31,7 @@ describe NabComAu::Account do
|
|
|
31
31
|
_(account.send(:login_page_password_field_selector)).must_equal({id: 'password'})
|
|
32
32
|
_(account.send(:login_page_submit_button_selector)).must_equal({xpath: "//button[contains(text(), 'Login')]"})
|
|
33
33
|
_(account.send(:logout_button_selector)).must_equal({id: 'logoutButton'})
|
|
34
|
+
_(account.logged_out_selector).must_equal({xpath: "//*[contains(text(), 'You have been successfully logged out.')]"})
|
|
34
35
|
end
|
|
35
36
|
|
|
36
37
|
it "gives way to a keyword given to new()" do
|
|
@@ -71,14 +72,19 @@ describe NabComAu::Account do
|
|
|
71
72
|
end
|
|
72
73
|
|
|
73
74
|
describe "#login" do
|
|
74
|
-
it "says username
|
|
75
|
+
it "says username is missing, before using the browser" do
|
|
75
76
|
error = _{account(password: 'password').login}.must_raise ArgumentError
|
|
76
|
-
_(error.message).
|
|
77
|
+
_(error.message).must_equal 'username is missing.'
|
|
77
78
|
end
|
|
78
79
|
|
|
79
|
-
it "says password
|
|
80
|
+
it "says password is missing, before using the browser" do
|
|
80
81
|
error = _{account(username: 'username').login}.must_raise ArgumentError
|
|
81
|
-
_(error.message).
|
|
82
|
+
_(error.message).must_equal 'password is missing.'
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
it "says both are missing at once, before using the browser" do
|
|
86
|
+
error = _{account.login}.must_raise ArgumentError
|
|
87
|
+
_(error.message).must_equal 'username, password are missing.'
|
|
82
88
|
end
|
|
83
89
|
end
|
|
84
90
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: nab_com_au
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- thoran
|
|
@@ -29,14 +29,14 @@ dependencies:
|
|
|
29
29
|
requirements:
|
|
30
30
|
- - "~>"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: '0.
|
|
32
|
+
version: '0.9'
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - "~>"
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: '0.
|
|
39
|
+
version: '0.9'
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
41
|
name: minitest
|
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|