scinote-web/features/step_definitions/result_steps.rb

31 lines
800 B
Ruby
Raw Normal View History

2019-12-17 18:36:19 +08:00
# frozen_string_literal: true
Given(/^I'm on the Results page of a "([^"]*)" task$/) do |task_name|
2019-12-17 18:36:19 +08:00
task = MyModule.find_by(name: task_name)
visit results_my_module_path(task)
end
Given(/^I click edit "(.+)" result icon$/) do |result_name|
find('.panel-heading', text: result_name).find('.edit-result-asset').click
end
2019-12-17 18:21:49 +08:00
2019-12-17 18:36:19 +08:00
Then('I input {string} in cell') do |input|
2019-12-17 18:21:49 +08:00
find('.handsontableInput').set(input)
2019-12-17 18:36:19 +08:00
end
2019-12-17 18:21:49 +08:00
2019-12-17 18:36:19 +08:00
Then('I click on table cell one') do
2019-12-17 18:21:49 +08:00
find('.htCore tbody td', match: :first).double_click
2019-12-17 18:36:19 +08:00
end
2019-12-17 18:21:49 +08:00
2019-12-17 18:36:19 +08:00
Given('I am on Task archive page') do
visit '/modules/1/archive'
2019-12-17 18:21:49 +08:00
end
2019-12-17 18:36:19 +08:00
Then('I change comment {string} with {string} of {string}') do |text1, text2, message_id|
find(message_id.to_s, text: text1).set(text2)
2019-12-17 18:21:49 +08:00
end
2019-12-17 18:36:19 +08:00
Given('I am on Task results page') do
visit '/modules/1/results'
end