From e6bf2209ced5b093dde5a7dc2145c7e9dcd821ae Mon Sep 17 00:00:00 2001 From: Cezar Augusto Date: Sat, 17 Jun 2017 16:01:57 -0300 Subject: [PATCH] Add test case for sequentially closing tabs Auditors: @bridiver Test Plan: npm run test -- --grep="sequentially closing tabs" --- test/tab-components/tabTest.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/test/tab-components/tabTest.js b/test/tab-components/tabTest.js index 7473e397347..112e5d84f0d 100644 --- a/test/tab-components/tabTest.js +++ b/test/tab-components/tabTest.js @@ -333,6 +333,40 @@ describe('tab tests', function () { }) }) + describe('sequentially closing tabs', function () { + Brave.beforeAll(this) + before(function * () { + const page1 = Brave.server.url('adblock2.html') + const page2 = Brave.server.url('red_bg.html') + const page3 = Brave.server.url('yellow_header.html') + + yield setup(this.app.client) + yield this.app.client + .newTab({ url: page1 }) + .waitForUrl(page1) + .windowByUrl(Brave.browserWindowUrl) + .waitForExist('[data-test-id="tab"][data-frame-key="2"]') + .newTab({ url: page2 }) + .waitForUrl(page2) + .windowByUrl(Brave.browserWindowUrl) + .waitForExist('[data-test-id="tab"][data-frame-key="3"]') + .newTab({ url: page3 }) + .waitForUrl(page3) + .windowByUrl(Brave.browserWindowUrl) + .waitForExist('[data-test-id="tab"][data-frame-key="4"]') + }) + + it('fallsback to last active tab if next tab does not exist', function * () { + yield this.app.client.changeSetting(settings.SHOW_TAB_PREVIEWS, false) + yield this.app.client + .moveToObject('[data-test-id="tab"][data-frame-key="3"]') + .middleClick('[data-test-id="tab"][data-frame-key="3"]') + .moveToObject('[data-test-id="tab"][data-frame-key="4"]') + .middleClick('[data-test-id="tab"][data-frame-key="4"]') + .waitForVisible('[data-test-active-tab="true"][data-frame-key="2"]') + }) + }) + describe('webview previews when tab is hovered', function () { Brave.beforeAll(this) before(function * () {