[CORD-1133] E2E GUI Tests
Change-Id: I521d0cc068a3e328f3d4f421ba4b342bea167e19
diff --git a/e2e/keyboard-shortcuts/keyboard.po.js b/e2e/keyboard-shortcuts/keyboard.po.js
new file mode 100644
index 0000000..7c84e62
--- /dev/null
+++ b/e2e/keyboard-shortcuts/keyboard.po.js
@@ -0,0 +1,11 @@
+module.exports = new function(){
+
+ const body = element(by.css('body'));
+
+ this.pressKey = (key) => {
+ body.sendKeys(key);
+ };
+
+ this.sidePanel = element(by.css('xos-side-panel > section'));
+ this.searchField = element(by.model('vm.query'));
+};
diff --git a/e2e/keyboard-shortcuts/shortcut.spec.js b/e2e/keyboard-shortcuts/shortcut.spec.js
new file mode 100644
index 0000000..3756a52
--- /dev/null
+++ b/e2e/keyboard-shortcuts/shortcut.spec.js
@@ -0,0 +1,19 @@
+const user = require('../test_helpers/user');
+const page = require('./keyboard.po');
+
+describe('XOS Keyboard Shortcuts', function() {
+
+ beforeEach(() => {
+ user.login();
+ });
+
+ it('should open the side panel when ? is pressed', () => {
+ page.pressKey('?');
+ expect(page.sidePanel.getAttribute('class')).toMatch('open');
+ });
+
+ it('should select the search form when f is pressed', () => {
+ page.pressKey('f');
+ expect(page.searchField.getAttribute('placeholder')).toEqual(browser.driver.switchTo().activeElement().getAttribute('placeholder'));
+ });
+});
\ No newline at end of file