-
Notifications
You must be signed in to change notification settings - Fork 1
/
keka.rb
38 lines (26 loc) · 792 Bytes
/
keka.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
# frozen_string_literal: true
require 'watir'
require 'pry'
class Keka
EMAIL = '[email protected]'
PASSWORD = 'password'
URL = 'https://changeme.keka.com/ui/#'
def start
browser = Watir::Browser.new
browser.goto("#{URL}/home/dashboard")
browser.input(id: "email").send_keys(EMAIL)
browser.input(id: "password").send_keys(PASSWORD)
browser.button(text: 'Login').click
browser.goto("#{URL}/me/attendance/logs")
sleep(15)
if browser.a(:text => 'Web Clock-In').exist?
browser.a(:text => 'Web Clock-In').click
elsif browser.button(:text => 'Web Clock-out').exist?
browser.button(text: 'Web Clock-out').click
browser.button(text: 'Clock-out').click
end
sleep(5)
browser.quit
end
end
Keka.new.start