mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-07 08:54:19 +08:00
Bumps [jspreadsheet-ce](https://github.com/jspreadsheet/ce) from 4.15.0 to 5.0.4. - [Release notes](https://github.com/jspreadsheet/ce/releases) - [Commits](https://github.com/jspreadsheet/ce/commits) --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
44 lines
1.1 KiB
Ruby
44 lines
1.1 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Modals
|
|
class InsertTable < PageObjects::Modals::Base
|
|
MODAL_SELECTOR = ".insert-table-modal"
|
|
SPREADSHEET_TABLE_SELECTOR = "#{MODAL_SELECTOR} .jss_worksheet"
|
|
|
|
def click_insert_table
|
|
find("#{MODAL_SELECTOR} .btn-insert-table").click
|
|
end
|
|
|
|
def cancel
|
|
click_button(I18n.t("js.cancel"))
|
|
end
|
|
|
|
def click_edit_reason
|
|
find("#{MODAL_SELECTOR} .btn-edit-reason").click
|
|
end
|
|
|
|
def type_edit_reason(text)
|
|
find("#{MODAL_SELECTOR} .edit-reason input").send_keys(text)
|
|
end
|
|
|
|
def find_cell(row, col)
|
|
find("#{SPREADSHEET_TABLE_SELECTOR} tbody tr[data-y='#{row}'] td[data-x='#{col}']")
|
|
end
|
|
|
|
def select_cell(row, col)
|
|
find_cell(row, col).double_click
|
|
end
|
|
|
|
def type_in_cell(row, col, text)
|
|
select_cell(row, col)
|
|
cell = find_cell(row, col).find("textarea")
|
|
cell.send_keys(text, :return)
|
|
end
|
|
|
|
def has_content_in_cell?(row, col, content)
|
|
find_cell(row, col).text == content
|
|
end
|
|
end
|
|
end
|
|
end
|