|
1 |
| -/* global describe, it, before */ |
| 1 | +/* global describe, it, before, beforeEach */ |
2 | 2 |
|
3 | 3 | const Brave = require('../lib/brave')
|
4 | 4 | const messages = require('../../js/constants/messages')
|
5 | 5 | const settings = require('../../js/constants/settings')
|
6 |
| -const {urlInput, backButton, forwardButton, activeTabTitle} = require('../lib/selectors') |
| 6 | +const {urlInput, backButton, forwardButton, activeTabTitle, newFrameButton} = require('../lib/selectors') |
7 | 7 |
|
8 |
| -describe('tabs', function () { |
| 8 | +describe('tab tests', function () { |
9 | 9 | function * setup (client) {
|
10 | 10 | yield client
|
11 | 11 | .waitForUrl(Brave.newTabUrl)
|
@@ -73,6 +73,31 @@ describe('tabs', function () {
|
73 | 73 | })
|
74 | 74 | })
|
75 | 75 |
|
| 76 | + describe('new tab button', function () { |
| 77 | + Brave.beforeEach(this) |
| 78 | + beforeEach(function * () { |
| 79 | + yield setup(this.app.client) |
| 80 | + }) |
| 81 | + |
| 82 | + it('creates a new tab when clicked', function * () { |
| 83 | + yield this.app.client |
| 84 | + .click(newFrameButton) |
| 85 | + .waitForExist('.tab[data-frame-key="2"]') |
| 86 | + }) |
| 87 | + it('shows a context menu when long pressed (click and hold)', function * () { |
| 88 | + yield this.app.client |
| 89 | + .moveToObject(newFrameButton) |
| 90 | + .buttonDown(0) |
| 91 | + .waitForExist('.contextMenu .contextMenuItem .contextMenuItemText') |
| 92 | + .buttonUp(0) |
| 93 | + }) |
| 94 | + it('shows a context menu when right clicked', function * () { |
| 95 | + yield this.app.client |
| 96 | + .rightClick(newFrameButton) |
| 97 | + .waitForExist('.contextMenu .contextMenuItem .contextMenuItemText') |
| 98 | + }) |
| 99 | + }) |
| 100 | + |
76 | 101 | describe('tab order', function () {
|
77 | 102 | describe('sequentially by default', function () {
|
78 | 103 | Brave.beforeAll(this)
|
|
0 commit comments