|
|
|
@ -71,16 +71,25 @@ describe("navigate test", () => { |
|
|
|
|
http.close(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
beforeEach(async() => { |
|
|
|
|
let tabs = await browser.tabs.query({}); |
|
|
|
|
for (let tab of tabs.slice(1)) { |
|
|
|
|
await browser.tabs.remove(tab.id); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
it('should go to parent path without hash by gu', async () => { |
|
|
|
|
await session.navigateTo(`http://127.0.0.1:${port}/a/b/c`); |
|
|
|
|
let body = await session.findElementByCSS('body'); |
|
|
|
|
|
|
|
|
|
await body.sendKeys('g', 'u'); |
|
|
|
|
|
|
|
|
|
await eventually(async() => { |
|
|
|
|
let tab = (await browser.tabs.query({}))[0]; |
|
|
|
|
let url = new URL(tab.url); |
|
|
|
|
assert.equal(url.pathname, `/a/b/`) |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('should remove hash by gu', async () => { |
|
|
|
|
await session.navigateTo(`http://127.0.0.1:${port}/a/b/c#hash`); |
|
|
|
@ -88,11 +97,13 @@ describe("navigate test", () => { |
|
|
|
|
|
|
|
|
|
await body.sendKeys('g', 'u'); |
|
|
|
|
|
|
|
|
|
await eventually(async() => { |
|
|
|
|
let tab = (await browser.tabs.query({}))[0]; |
|
|
|
|
let url = new URL(tab.url); |
|
|
|
|
assert.equal(url.hash, '') |
|
|
|
|
assert.equal(url.pathname, `/a/b/c`) |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('should go to root path by gU', async () => { |
|
|
|
|
await session.navigateTo(`http://127.0.0.1:${port}/a/b/c#hash`); |
|
|
|
|