From 638af8778a27ed70b892f81c135baaed5c1474c9 Mon Sep 17 00:00:00 2001 From: YusukeIwaki Date: Tue, 27 Oct 2020 03:08:32 +0900 Subject: [PATCH] add RSpec for YusukeIwaki/puppeteer-ruby/pull/25 --- spec/integration/keyboard_spec.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/spec/integration/keyboard_spec.rb b/spec/integration/keyboard_spec.rb index 499eae3f..2455656d 100644 --- a/spec/integration/keyboard_spec.rb +++ b/spec/integration/keyboard_spec.rb @@ -17,6 +17,21 @@ page.keyboard.type_text(text) expect(page.evaluate("() => document.querySelector('textarea').value")).to eq(text) end + + it 'should input ( by type_text method' do + text = '(puppeteer)' + page.keyboard.type_text(text) + expect(page.evaluate("() => document.querySelector('textarea').value")).to eq(text) + end + + it 'should input ( by pressing Shift + 9' do + page.keyboard do + down('Shift') + press('Digit9') + up('Shift') + end + expect(page.evaluate("() => document.querySelector('textarea').value")).to eq('(') + end end context 'with key event listener content' do