A fork of https://github.com/ueokande/vim-vixen
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.6 KiB
66 lines
1.6 KiB
5 years ago
|
import * as path from 'path';
|
||
|
import * as assert from 'assert';
|
||
|
|
||
|
import eventually from './eventually';
|
||
|
import { Builder, Lanthan } from 'lanthan';
|
||
|
import { WebDriver, WebElement, By } from 'selenium-webdriver';
|
||
|
|
||
6 years ago
|
|
||
|
describe("zoom test", () => {
|
||
5 years ago
|
let lanthan: Lanthan;
|
||
|
let webdriver: WebDriver;
|
||
|
let browser: any;
|
||
|
let tab: any;
|
||
|
let body: WebElement;
|
||
6 years ago
|
|
||
|
before(async() => {
|
||
5 years ago
|
lanthan = await Builder
|
||
|
.forBrowser('firefox')
|
||
|
.spyAddon(path.join(__dirname, '..'))
|
||
|
.build();
|
||
|
webdriver = lanthan.getWebDriver();
|
||
|
browser = lanthan.getWebExtBrowser();
|
||
6 years ago
|
tab = (await browser.tabs.query({}))[0]
|
||
|
});
|
||
|
|
||
|
after(async() => {
|
||
5 years ago
|
await lanthan.quit();
|
||
6 years ago
|
});
|
||
|
|
||
|
beforeEach(async() => {
|
||
5 years ago
|
await webdriver.navigate().to('about:blank');
|
||
|
body = await webdriver.findElement(By.css('body'));
|
||
6 years ago
|
});
|
||
|
|
||
|
it('should zoom in by zi', async () => {
|
||
|
let before = await browser.tabs.getZoom(tab.id);
|
||
|
await body.sendKeys('z', 'i');
|
||
|
|
||
|
await eventually(async() => {
|
||
|
let actual = await browser.tabs.getZoom(tab.id);
|
||
5 years ago
|
assert.ok(before < actual);
|
||
6 years ago
|
});
|
||
|
});
|
||
|
|
||
|
it('should zoom out by zo', async () => {
|
||
|
let before = await browser.tabs.getZoom(tab.id);
|
||
|
await body.sendKeys('z', 'o');
|
||
|
|
||
|
await eventually(async() => {
|
||
|
let actual = await browser.tabs.getZoom(tab.id);
|
||
5 years ago
|
assert.ok(before > actual);
|
||
6 years ago
|
});
|
||
|
});
|
||
|
|
||
|
it('scrolls left by h', async () => {
|
||
|
await browser.tabs.setZoom(tab.id, 2);
|
||
|
await body.sendKeys('z', 'z');
|
||
|
|
||
|
await eventually(async() => {
|
||
|
let actual = await browser.tabs.getZoom(tab.id);
|
||
5 years ago
|
assert.ok(actual === 1);
|
||
6 years ago
|
});
|
||
|
});
|
||
|
});
|
||
|
|