Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Add test case for sequentially closing tabs
Browse files Browse the repository at this point in the history
Auditors: @bridiver
Test Plan:
npm run test -- --grep="sequentially closing tabs"
  • Loading branch information
cezaraugusto committed Jun 20, 2017
1 parent 8cd454b commit e6bf220
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions test/tab-components/tabTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 * () {
Expand Down

0 comments on commit e6bf220

Please sign in to comment.