Skip to content

Commit

Permalink
Agent publish
Browse files Browse the repository at this point in the history
  • Loading branch information
blacksmith-welder committed Feb 24, 2025
1 parent 773ccce commit c219788
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion staff_features/agents/agent_publish.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Feature: Agent Publish
Given the Agent is opened in edit mode
When the user checks 'Publish'
And the user clicks on 'Save'
Then the 'Agent' updated message is displayed
Then the 'Agent' saved message is displayed
And the 'View Published' button is displayed
Scenario: View a published Agent Record in the public interface
Given the Agent is opened in edit mode
Expand Down
1 change: 1 addition & 0 deletions staff_features/agents/step_definitions/agent_edit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

fill_in 'Primary Part of Name', with: "Agent #{@uuid}"
select 'Local sources', from: 'Source'
check 'Publish'
click_on 'Save'

expect(find('.alert.alert-success.with-hide-alert').text).to eq 'Agent Created'
Expand Down
21 changes: 21 additions & 0 deletions staff_features/agents/step_definitions/agent_publish.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true

Then 'the Agent opens on a new tab in the public interface' do
expect(page.windows.size).to eq 2
switch_to_window(page.windows[1])

tries = 0

while current_url == 'about:blank'
break if tries == 3

tries += 1
sleep 1
end

expect(current_url).to eq "#{PUBLIC_URL}/agents/people/#{@agent_id}"
end

Given 'the Agent is published' do
expect(find('#agent_publish_').checked?).to eq true
end

0 comments on commit c219788

Please sign in to comment.