2019-12-17 18:36:19 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-09-03 21:14:37 +08:00
|
|
|
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)
|
2019-09-03 21:14:37 +08:00
|
|
|
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
|