-
Notifications
You must be signed in to change notification settings - Fork 0
/
activity4_object.rb
49 lines (39 loc) · 1.09 KB
/
activity4_object.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
require "./base_object"
require './draw_tool_object'
require './lara_object'
class Activity4Object < BaseObject
include (DrawToolObject)
include (LARAObject)
ROOT_URL = 'https://authoring.staging.concord.org/'
ACTIVITY_TITLE = {css: '.h2'}
PAGE_TITLE = {css: '.h4'}
PAGE_ICONS = {css: '.pagination-link'}
SNAPSHOT_BUTTON = {css: '.image_snapshot_button'}
DRAWING_BUTTON = {css: '.image-drawing-button'}
IMAGE_DIALOG = {css: '.image-question-dialog'}
IMAGE_DONE_BUTTON = {css: '.image_done_button'}
SPINNER = {css: '.wait-for'}
def initialize()
puts "Initialized"
end
def verify_activity(title)
puts "Activity is #{title}"
header = find(ACTIVITY_TITLE).text
expect(header).to include(title)
end
def verify_page(title)
puts "Page title is #{title}"
header = find(PAGE_TITLE).text
expect(header).to include(title)
end
def get_pages
find_all(PAGE_ICONS)
end
def open_draw_tool
wait_for { displayed?(DRAWING_BUTTON) }
click_on(DRAWING_BUTTON)
wait_for { displayed? (IMAGE_DIALOG)}
switch_to_modal()
sleep (8)
end
end