File tree 2 files changed +35
-0
lines changed
e2e/functional/document_tests
2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,19 @@ context('Bookmarks', function () {
47
47
resourcesPanel . getCanvasItemTitle ( 'my-work' , 'bookmarks' ) . contains ( copyDocumentTitle ) . should ( 'exist' ) ;
48
48
resourcesPanel . getCanvasItemTitle ( 'my-work' , 'bookmarks' ) . contains ( title ) . should ( 'exist' ) ;
49
49
50
+ cy . log ( 'verify second document can be opened in bookmarks panel' ) ;
51
+ resourcesPanel . getFocusDocumentTitle ( ) . contains ( title ) ;
52
+ resourcesPanel . getCanvasItemTitle ( 'my-work' , 'bookmarks' ) . contains ( copyDocumentTitle ) . click ( ) ;
53
+ // There is confusing behavior here where the first click on another document doesn't open this as the
54
+ // the second document, instead it toggles the primary document to be this one. This happens
55
+ // because there is no explicit primary document initially. So this first click tries to set this
56
+ // secondary document but because there is no primary the persistent ui stores it as the primary doc.
57
+ resourcesPanel . getFocusDocumentTitle ( ) . contains ( copyDocumentTitle ) ;
58
+ // Now clicking back on the first document in the list should open it as the "secondary" document.
59
+ resourcesPanel . getCanvasItemTitle ( 'my-work' , 'bookmarks' ) . contains ( title ) . click ( ) ;
60
+ resourcesPanel . getPrimaryFocusDocumentTitle ( ) . contains ( copyDocumentTitle ) ;
61
+ resourcesPanel . getSecondaryFocusDocumentTitle ( ) . contains ( title ) ;
62
+
50
63
cy . log ( 'verify publish personal document' ) ;
51
64
canvas . publishCanvas ( "personal" ) ;
52
65
resourcesPanel . openTopTab ( 'class-work' ) ;
Original file line number Diff line number Diff line change @@ -99,5 +99,27 @@ class ResourcesPanel{
99
99
// but the top level (navTab) of this sub tab is not active/selected.
100
100
return cy . get ( '.nav-tab-panel .react-tabs__tab-panel--selected .react-tabs__tab-panel--selected .edit-button' ) ;
101
101
}
102
+
103
+ getFocusDocument ( ) {
104
+ return cy . get ( '.focus-document' ) ;
105
+ }
106
+
107
+ getFocusDocumentTitle ( ) {
108
+ return this . getFocusDocument ( ) . find ( '.document-title' ) ;
109
+ }
110
+
111
+ // The Primary and Secondary documents are used in the bookmarks tab
112
+ getPrimaryFocusDocument ( ) {
113
+ return cy . get ( '.focus-document.primary' ) ;
114
+ }
115
+ getPrimaryFocusDocumentTitle ( ) {
116
+ return this . getFocusDocument ( ) . find ( '.document-title' ) ;
117
+ }
118
+ getSecondaryFocusDocument ( ) {
119
+ return cy . get ( '.focus-document.secondary' ) ;
120
+ }
121
+ getSecondaryFocusDocumentTitle ( ) {
122
+ return this . getFocusDocument ( ) . find ( '.document-title' ) ;
123
+ }
102
124
}
103
125
export default ResourcesPanel ;
You can’t perform that action at this time.
0 commit comments