@@ -20,10 +20,6 @@ describe('readOnly: true / Read-Only Edition', function () {
2020
2121 before ( function ( ) {
2222 skipForWeb ( this , 'settings modal not available on compass-web' ) ;
23- // TODO(COMPASS-8005): port these once implemented
24- if ( TEST_MULTIPLE_CONNECTIONS ) {
25- this . skip ( ) ;
26- }
2723 } ) ;
2824
2925 beforeEach ( async function ( ) {
@@ -44,12 +40,24 @@ describe('readOnly: true / Read-Only Edition', function () {
4440 await browser . setFeature ( 'readOnly' , true ) ;
4541 await browser . connectWithConnectionString ( ) ;
4642
47- let sidebarCreateDatabaseButton = await browser . $ (
48- Selectors . SidebarCreateDatabaseButton
49- ) ;
50- let isSidebarCreateDatabaseButtonExisting =
51- await sidebarCreateDatabaseButton . isExisting ( ) ;
52- expect ( isSidebarCreateDatabaseButtonExisting ) . to . be . equal ( false ) ;
43+ const connectionName = connectionNameFromString ( DEFAULT_CONNECTION_STRING ) ;
44+
45+ if ( TEST_MULTIPLE_CONNECTIONS ) {
46+ // navigate to the databases tab so that the connection is
47+ // active/highlighted and then the add button and three dot menu will
48+ // display without needing to hover
49+ await browser . navigateToConnectionTab ( connectionName , 'Databases' ) ;
50+ expect (
51+ await browser . $ ( Selectors . Multiple . CreateDatabaseItem ) . isExisting ( )
52+ ) . to . be . equal ( false ) ;
53+ } else {
54+ const sidebarCreateDatabaseButton = await browser . $ (
55+ Selectors . SidebarCreateDatabaseButton
56+ ) ;
57+ const isSidebarCreateDatabaseButtonExisting =
58+ await sidebarCreateDatabaseButton . isExisting ( ) ;
59+ expect ( isSidebarCreateDatabaseButtonExisting ) . to . be . equal ( false ) ;
60+ }
5361
5462 await browser . openSettingsModal ( ) ;
5563 const settingsModal = await browser . $ ( Selectors . SettingsModal ) ;
@@ -62,12 +70,19 @@ describe('readOnly: true / Read-Only Edition', function () {
6270 // wait for the modal to go away
6371 await settingsModal . waitForDisplayed ( { reverse : true } ) ;
6472
65- sidebarCreateDatabaseButton = await browser . $ (
66- Selectors . SidebarCreateDatabaseButton
67- ) ;
68- isSidebarCreateDatabaseButtonExisting =
69- await sidebarCreateDatabaseButton . isExisting ( ) ;
70- expect ( isSidebarCreateDatabaseButtonExisting ) . to . be . equal ( true ) ;
73+ if ( TEST_MULTIPLE_CONNECTIONS ) {
74+ await browser . navigateToConnectionTab ( connectionName , 'Databases' ) ;
75+ expect (
76+ await browser . $ ( Selectors . Multiple . CreateDatabaseItem ) . isExisting ( )
77+ ) . to . be . equal ( true ) ;
78+ } else {
79+ const sidebarCreateDatabaseButton = await browser . $ (
80+ Selectors . SidebarCreateDatabaseButton
81+ ) ;
82+ const isSidebarCreateDatabaseButtonExisting =
83+ await sidebarCreateDatabaseButton . isExisting ( ) ;
84+ expect ( isSidebarCreateDatabaseButtonExisting ) . to . be . equal ( true ) ;
85+ }
7186 } ) ;
7287
7388 it ( 'shows and hides the plus icon on the siderbar to create a collection' , async function ( ) {
0 commit comments