aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--e2e/contents/zoom.test.js78
1 files changed, 29 insertions, 49 deletions
diff --git a/e2e/contents/zoom.test.js b/e2e/contents/zoom.test.js
index c7efc93..2d90e28 100644
--- a/e2e/contents/zoom.test.js
+++ b/e2e/contents/zoom.test.js
@@ -7,64 +7,44 @@ describe("zoom test", () => {
let targetWindow;
let targetTab;
- before(() => {
- return windows.create(CLIENT_URL).then((win) => {
- targetWindow = win;
- });
+ before(async () => {
+ targetWindow = await windows.create(CLIENT_URL);
});
- after(() => {
- return windows.remove(targetWindow.id);
+ after(async () => {
+ await windows.remove(targetWindow.id);
});
- beforeEach(() => {
- return tabs.create(targetWindow.id, CLIENT_URL).then((tab) => {
- targetTab = tab;
- });
+ beforeEach(async () => {
+ targetTab = await tabs.create(targetWindow.id, CLIENT_URL);
});
- 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 zi', async () => {
+ let before = await tabs.getZoom(targetTab.id);
+ await keys.press(targetTab.id, 'z');
+ await keys.press(targetTab.id, 'i');
+
+ let actual = await tabs.getZoom(targetTab.id);
+ 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 zo', async () => {
+ let before = await tabs.getZoom(targetTab.id);
+ await keys.press(targetTab.id, 'z');
+ await keys.press(targetTab.id, 'o');
+
+ let actual = await tabs.getZoom(targetTab.id);
+ 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);
- });
+ it('zooms-in by zz', async () => {
+ await tabs.setZoom(targetTab.id, 1.5);
+ let before = await tabs.getZoom(targetTab.id);
+ await keys.press(targetTab.id, 'z');
+ await keys.press(targetTab.id, 'z');
+
+ let actual = await tabs.getZoom(targetTab.id);
+ expect(actual).to.be.lessThan(before);
+ expect(actual).to.equal(1);
});
});