Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TA-2068 Files changed for Portal and Direct login #279

Merged
merged 2 commits into from
Mar 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions features/pages/outcome_page.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
module OutcomePage
def delete_all_outcomes
steps %(
Given a test firm user is on the portal login page
When user Logs in
Then Portal application page is displayed
When user clicks on CWA link
Given user is logged into cwa
Then CWA application page is displayed
When user navigates to Submissions page
Then Submission Search Page displayed
Expand Down
2 changes: 1 addition & 1 deletion features/step_definitions/bulk_load_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -357,4 +357,4 @@
And('the following new matter starts are added to the bulkload file:') do |table|
nms_data = table.hashes
@xml.add_nms_data(nms_data)
end
end
9 changes: 9 additions & 0 deletions features/step_definitions/cwa_login_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,12 @@
expect(page).to have_content('Navigator')
end
end

Given('user is logged into cwa') do
case ENV['TEST_ENV']
when "devmp", "stg"
direct_login
when "tst", "dev", "uat"
portal_login
end
end
20 changes: 5 additions & 15 deletions features/step_definitions/cwa_navigation_steps.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
Given('a test firm user is logged in CWA') do
steps %(
Given a test firm user is on the portal login page
When user Logs in
Then Portal application page is displayed
When user clicks on CWA link
Given user is logged into cwa
Then CWA application page is displayed
)
end
Expand All @@ -17,19 +14,16 @@

Then('Submission Search Page displayed') do
submission_list_page = SubmissionListPage.new
#puts "Waiting for submissions to be visible"


submission_list_page.wait_until_submissions_visible(wait: 10)
#puts "Setting account number: #{CWAProvider.submission.account_number}"
submission_list_page.account_number.set(CWAProvider.submission.account_number)

#puts "Waiting for area of law search to be visible"
submission_list_page.wait_until_area_of_law_search_visible(wait: 10)

# Debugging ambiguous match by listing all matching elements
#puts "Finding all select elements with id 'AreaOfLawSearch'"
elements = submission_list_page.all(:xpath, "//select[@id='AreaOfLawSearch']")

#puts "Number of select elements found: #{elements.size}"

elements.each_with_index do |element, index|
# puts "Element #{index}: id=#{element[:id]}, class=#{element[:class]}, name=#{element[:name]}"
end
Expand All @@ -45,7 +39,6 @@
end

submission_list_page.area_of_law_search.select(CWAProvider.submission.area_of_law)
#puts "Setting submission period: #{CWAProvider.submission.period}"
submission_list_page.submission_period.set(CWAProvider.submission.period)

#puts "Clicking search button"
Expand All @@ -56,10 +49,7 @@

Given('user is on the submission search page') do
steps %(
Given a test firm user is on the portal login page
When user Logs in
Then Portal application page is displayed
When user clicks on CWA link
Given user is logged into cwa
Then CWA application page is displayed
When user navigates to Submissions page
Then Submission Search Page displayed
Expand Down
5 changes: 1 addition & 4 deletions features/step_definitions/cwa_outcome_steps.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
Given('user is on their {string} submission details page') do |area_of_law|
CWAProvider.area_of_law = area_of_law.upcase
steps %(
Given a test firm user is on the portal login page
When user Logs in
And Portal application page is displayed
And user clicks on CWA link
Given user is logged into cwa
And CWA application page is displayed
And user navigates to Submissions page
And Submission Search Page displayed
Expand Down
18 changes: 18 additions & 0 deletions features/step_definitions/direct_login_steps.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Given('a test firm user is on the direct login page') do
visit(PortalEnv.url)
end

When('user Logs in directly') do
expect(page).to have_title("Login", wait:20)
fill_in 'username', with: PortalEnv.cwa_provider_user
fill_in 'password', with: PortalEnv.cwa_provider_user_password
find('img[title="Login"][alt="Login"]', wait: 10).click
end

def direct_login
steps %(
Given a test firm user is on the direct login page
When user Logs in directly
)
end

9 changes: 9 additions & 0 deletions features/step_definitions/portal_login_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,12 @@
Then Portal application page is displayed
)
end

def portal_login
steps %(
Given a test firm user is on the portal login page
When user Logs in
Then Portal application page is displayed
When user clicks on CWA link
)
end
Binary file modified features/support/cwa_env.yml
Binary file not shown.
Binary file modified features/support/portal_env.yml
Binary file not shown.
10 changes: 8 additions & 2 deletions features/support/ui/navigator_page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@ class NavigatorContent < SitePrism::Section
end

class NavigatorPage < SitePrism::Page
set_url "#{CWAProvider.url}/OA_HTML/OA.jsp?OAFunc=OAHOMEPAGE"

case ENV['TEST_ENV']
when "devmp", "stg"
set_url "#{CWAProvider.url[0..-28]}/OA_HTML/OA.jsp?OAFunc=OAHOMEPAGE" # 0..-28 removes the last 28 characters from the string
when "tst", "dev", "uat"
set_url "#{CWAProvider.url}/OA_HTML/OA.jsp?OAFunc=OAHOMEPAGE"
end

section :roles, RolesSection, :xpath, '//*[@id="responsibilityRN"]/table/tbody/tr/td[1]/table/tbody'
section :content, NavigatorContent, :xpath, '//*[@id="responsibilityRN"]/table/tbody/tr/td[2]/table/tbody'
end
end