Matteo Scandolo | 583234d | 2017-04-20 14:33:04 -0700 | [diff] [blame] | 1 | const user = require('../test_helpers/user'); |
| 2 | const page = require('./keyboard.po'); |
| 3 | |
| 4 | describe('XOS Keyboard Shortcuts', function() { |
| 5 | |
| 6 | beforeEach(() => { |
| 7 | user.login(); |
| 8 | }); |
| 9 | |
| 10 | it('should open the side panel when ? is pressed', () => { |
| 11 | page.pressKey('?'); |
| 12 | expect(page.sidePanel.getAttribute('class')).toMatch('open'); |
| 13 | }); |
| 14 | |
| 15 | it('should select the search form when f is pressed', () => { |
| 16 | page.pressKey('f'); |
| 17 | expect(page.searchField.getAttribute('placeholder')).toEqual(browser.driver.switchTo().activeElement().getAttribute('placeholder')); |
| 18 | }); |
| 19 | }); |