internal_tools 0.0.1

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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/internal_tools.rb +63 -0
  3. metadata +42 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: e61d8f3903dd75d802166bff7e8cc3a7b86ddeb0fc3e914952bccabcf9ba2592
4
+ data.tar.gz: c5930e5a4f8718d4f093c2c192e129de2c33ada9b4351e263fb84086b62aa4c2
5
+ SHA512:
6
+ metadata.gz: 75d4aeb691dd886fde884caede64cd6a0055cd105d79c840a218df1c465c9143a9ae691fc94b3bbd99e4d06da2da02fd3abd114de3ee369a9e1b722298ad08db
7
+ data.tar.gz: 8458c21d8c0e3559a581c5c08f60537e814b6a93f32024faaf35b51d51c9c89aa6c438a1417fdd0ff807098c30a38984083ba22ae899afbd50b96d712e87e11a
@@ -0,0 +1,63 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../pages/base_page'
4
+
5
+ # tips1
6
+ # class Menu < SitePrism::Section
7
+ # end
8
+
9
+ # tips2
10
+ # class Menu < SitePrism::Section
11
+ # set_default_search_arguments :id, 'main-menu-navigation'
12
+ # end
13
+
14
+ # tips3
15
+ class Menu < SitePrism::Section
16
+ element :order_menu, :xpath, '//div[@class="nav-item-wrapper cursor-pointer"]/div/div/div/span[text() = "Order"]'
17
+ element :fulfillment_menu, :xpath, '//div[@class="nav-item-wrapper cursor-pointer"]/div/div/div/span[text() = "Fulfillment"]'
18
+ element :transferstock_menu, :xpath, '//div[@class="nav-item-wrapper cursor-pointer"]/div/div/div/span[text() = "Transfer Stock"]'
19
+ element :stock_menu, :xpath, '//div[@class="nav-item-wrapper cursor-pointer"]/div/div/div/span[text() = "Stock"]'
20
+ element :productdb_menu, :xpath, '//div[@class="nav-item-wrapper cursor-pointer"]/div/div/div/span[text() = "Product Database"]'
21
+ element :purchasing_menu, :xpath, '//div[@class="nav-item-wrapper cursor-pointer"]/div/div/div/span[text() = "Purchasing"]'
22
+ element :reseller_menu, :xpath, '//div[@class="nav-item-wrapper cursor-pointer"]/div/div/div/span[text() = "Reseller"]'
23
+ element :retur_menu, :xpath, '//div[@class="nav-item-wrapper cursor-pointer"]/div/div/div/span[text() = "Retur"]'
24
+ element :content_menu, :xpath, '//div[@class="nav-item-wrapper cursor-pointer"]/div/div/div/span[text() = "Content"]'
25
+ end
26
+
27
+ class LoginPage < SitePrism::Page
28
+ include BasePage
29
+
30
+ path = get_config_data('WEB_BASE_URL_XMS')
31
+ set_url(path)
32
+
33
+ element :login_btn, :xpath, '//button[@class="login-btn btn btn-primary"]'
34
+ element :email_txtfield, :xpath, '//input[@id="Email"]|//input[@id="identifierId"]'
35
+ element :password_txtfield, :xpath, '//input[@id="password"]|//input[@type="password"]'
36
+ element :next_btn, :xpath, "//span[text()='Next']|//input[@id='next']|//input[@id='submit']"
37
+ element :profile, :xpath, "//div[@class='user-nav d-sm-flex d-none']"
38
+
39
+ section :main_menu, Menu, :id, 'main-menu-navigation'# tips1
40
+ # section :menu, Menu# tips2
41
+ # section :menu, Menu, 'ul[id="main-menu-navigation"]'# tips3
42
+
43
+ def validate_login_page
44
+ login_btn.should be_visible
45
+ sleep(2)
46
+ end
47
+
48
+ def input_valid_credential
49
+ execute_script("document.querySelector('.login-btn').click()")
50
+ switch_to_last_window
51
+ email_txtfield.set(ENV['EMAIL_VALID'])
52
+ next_btn.click
53
+ password_txtfield.should be_visible
54
+ password_txtfield.set(ENV['PASSWORD_VALID'])
55
+ next_btn.click
56
+ end
57
+
58
+ def validate_login_successfully
59
+ switch_to_first_window
60
+ main_menu.should be_visible#tips 1&2
61
+ # expect(menu).to have_order_menu#tips 3
62
+ end
63
+ end
metadata ADDED
@@ -0,0 +1,42 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: internal_tools
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Kevan Dharma
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-04-06 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description:
14
+ email:
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/internal_tools.rb
20
+ homepage:
21
+ licenses: []
22
+ metadata: {}
23
+ post_install_message:
24
+ rdoc_options: []
25
+ require_paths:
26
+ - lib
27
+ required_ruby_version: !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: '0'
32
+ required_rubygems_version: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
37
+ requirements: []
38
+ rubygems_version: 3.2.3
39
+ signing_key:
40
+ specification_version: 4
41
+ summary: A gem to login internal tools
42
+ test_files: []