aboutsummaryrefslogtreecommitdiff
path: root/e2e/contents/zoom.test.js
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2018-02-20 12:15:12 +0000
committerGitHub <noreply@github.com>2018-02-20 12:15:12 +0000
commitd0e4fc92ce678fdb18fc27a9810f7fb1c8b8a8f5 (patch)
tree8baade1379c6f5c5668a021b4ccbb57f9807f888 /e2e/contents/zoom.test.js
parenta708cb3bcf1bea5996802e813cd0da80456a9150 (diff)
parent8aade1c83629a63c86098831f660f1049eddc921 (diff)
Merge pull request #346 from ueokande/e2e-test
add zomm tests
Diffstat (limited to 'e2e/contents/zoom.test.js')
-rw-r--r--e2e/contents/zoom.test.js72
1 files changed, 72 insertions, 0 deletions
diff --git a/e2e/contents/zoom.test.js b/e2e/contents/zoom.test.js
new file mode 100644
index 0000000..c2e787f
--- /dev/null
+++ b/e2e/contents/zoom.test.js
@@ -0,0 +1,72 @@
+import { expect } from "chai";
+import * as windows from "../ambassador/src/client/windows";
+import * as tabs from "../ambassador/src/client/tabs";
+import * as keys from "../ambassador/src/client/keys";
+
+const SERVER_URL = "localhost:11111/";
+
+describe("tab test", () => {
+ let targetWindow;
+ let targetTab;
+
+ before(() => {
+ return windows.create(SERVER_URL).then((win) => {
+ targetWindow = win;
+ });
+ });
+
+ after(() => {
+ return windows.remove(targetWindow.id);
+ });
+
+ beforeEach(() => {
+ return tabs.create(targetWindow.id, SERVER_URL).then((tab) => {
+ targetTab = tab;
+ });
+ });
+
+ it('zooms-in by zi', () => {
+ let before;
+ return tabs.getZoom(targetTab.id).then((zoom) => {
+ before = zoom;
+ return keys.press(targetTab.id, 'z');
+ }).then(() => {
+ return keys.press(targetTab.id, 'i');
+ }).then(() => {
+ return tabs.getZoom(targetTab.id);
+ }).then((actual) => {
+ expect(actual).to.be.greaterThan(before);
+ });
+ });
+
+ it('zooms-in by zo', () => {
+ let before;
+ return tabs.getZoom(targetTab.id).then((zoom) => {
+ before = zoom;
+ return keys.press(targetTab.id, 'z');
+ }).then(() => {
+ return keys.press(targetTab.id, 'o');
+ }).then(() => {
+ return tabs.getZoom(targetTab.id);
+ }).then((actual) => {
+ expect(actual).to.be.lessThan(before);
+ });
+ });
+
+ it('zooms-in by zz', () => {
+ let before;
+ tabs.setZoom(targetTab.id, 1.5).then(() => {
+ return tabs.getZoom(targetTab.id);
+ }).then((zoom) => {
+ before = zoom;
+ return keys.press(targetTab.id, 'z');
+ }).then(() => {
+ return keys.press(targetTab.id, 'z');
+ }).then(() => {
+ return tabs.getZoom(targetTab.id);
+ }).then((actual) => {
+ expect(actual).to.be.lessThan(before);
+ expect(actual).to.be.be(1);
+ });
+ });
+});