@@ -4,7 +4,7 @@ const Brave = require('../lib/brave')
4
4
const messages = require ( '../../js/constants/messages' )
5
5
const assert = require ( 'assert' )
6
6
const settings = require ( '../../js/constants/settings' )
7
- const { urlInput, backButton, forwardButton, activeTab, activeTabTitle, activeTabFavicon, newFrameButton, notificationBar} = require ( '../lib/selectors' )
7
+ const { urlInput, backButton, forwardButton, activeTab, activeTabTitle, activeTabFavicon, newFrameButton, notificationBar, contextMenu } = require ( '../lib/selectors' )
8
8
9
9
describe ( 'tab tests' , function ( ) {
10
10
function * setup ( client ) {
@@ -56,6 +56,40 @@ describe('tab tests', function () {
56
56
. then ( ( title ) => title === 'Page 2' )
57
57
} )
58
58
} )
59
+
60
+ it ( 'middle click opens in the new tab' , function * ( ) {
61
+ var page1 = Brave . server . url ( 'page1.html' )
62
+ var page2 = Brave . server . url ( 'page2.html' )
63
+
64
+ yield this . app . client
65
+ . tabByIndex ( 0 )
66
+ . loadUrl ( page1 )
67
+ . windowByUrl ( Brave . browserWindowUrl )
68
+ . waitUntil ( function ( ) {
69
+ return this . getText ( activeTabTitle )
70
+ . then ( ( title ) => title === 'Page 1' )
71
+ } )
72
+ . tabByIndex ( 0 )
73
+ . loadUrl ( page2 )
74
+ . windowByUrl ( Brave . browserWindowUrl )
75
+ . waitUntil ( function ( ) {
76
+ return this . getText ( activeTabTitle )
77
+ . then ( ( title ) => title === 'Page 2' )
78
+ } )
79
+ . waitForExist ( backButton )
80
+ . click ( backButton )
81
+ . waitForUrl ( page1 )
82
+ . windowByUrl ( Brave . browserWindowUrl )
83
+ . waitUntil ( function ( ) {
84
+ return this . getText ( activeTabTitle )
85
+ . then ( ( title ) => title === 'Page 1' )
86
+ } )
87
+ . waitForExist ( '.forwardButton' )
88
+ . rightClick ( forwardButton )
89
+ . waitForExist ( contextMenu )
90
+ . middleClick ( `${ contextMenu } [data-index="0"]` )
91
+ . waitForTabCount ( 2 )
92
+ } )
59
93
} )
60
94
61
95
describe ( 'new tab signal' , function ( ) {
0 commit comments