Skip to content

Commit

Permalink
WIP: Cucumber fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
r-richardson committed Dec 19, 2023
1 parent c32b546 commit 9ced60e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
6 changes: 2 additions & 4 deletions testsuite/features/reposync/srv_sync_repo_sync.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Licensed under the terms of the MIT license.

Feature: Strict Mode for Channel Synchronization
In order to control strict mode synchronization
In order to control strict mode when syncing channels
As an admin user
I want to be able to toggle strict mode synchronization via the UI and command line

Expand All @@ -27,7 +27,6 @@ Scenario: Prepare repos for strict test
And I click on "Create Repository"
Then I should see a "Repository created successfully" text

@rrichardson-test
Scenario: Testing strict mode
Given I am authorized for the "Admin" section
And I follow the left menu "Software > Manage > Channels"
Expand All @@ -38,7 +37,7 @@ Scenario: Testing strict mode
And I follow "Sync" in the "content area"
And I click on "Sync Now"
And I wait at most 60 seconds until I do not see "Repository sync is running." text, refreshing the page
And I check the amount of packages in channel "test-strict-channel"
And I store the amount of packages in channel "test-strict-channel"
And I follow "Add / Remove"
And I uncheck "fake-rpm-repo" in the list
And I check "fake-rpm-repo-modified" in the list
Expand All @@ -48,7 +47,6 @@ Scenario: Testing strict mode
And I click on "Sync Now"
And I wait at most 60 seconds until I do not see "Repository sync is running." text, refreshing the page
Then The amount of packages in channel "Test-Strict-Channel" should be the same as before

And I uncheck "no-strict"
And I click on "Sync Now"
And I wait at most 60 seconds until I do not see "Repository sync is running." text, refreshing the page
Expand Down
12 changes: 5 additions & 7 deletions testsuite/features/step_definitions/command_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,11 @@
raise 'Failed to login to the API' unless response.code == 200
end

$package_amount = nil

When(/^I check the amount of packages in channel "([^"]*)"$/) do |channel_label|
channels = $api_test.channel.list_all_channels
if channels.key?(channel_label)
package_amount = channels[channel_label]['packages']
puts "Package amount for 'test-strict': #{package_amount}"
When(/^I store the amount of packages in channel "([^"]*)"$/) do |channel_label|
add_context(channels, $api_test.channel.list_all_channels)
if get_context(channels).key?(channel_label)
add_context(package_amount, get_context(channels)[channel_label]['packages'])
puts "Package amount for 'test-strict': #{get_context(package_amount)}"
else
puts "#{channel_label} channel not found."
end
Expand Down

0 comments on commit 9ced60e

Please sign in to comment.