This repository was archived by the owner on Apr 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +20
-6
lines changed Expand file tree Collapse file tree 3 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -3,11 +3,25 @@ import "../support/index";
3
3
describe ( "The filesystem page" , ( ) => {
4
4
beforeEach ( ( ) => {
5
5
cy . log ( "Login before every test" ) ;
6
- cy . loginWithUrl ( "/file" ) ;
6
+
7
7
} ) ;
8
8
9
9
it ( "changes the url when you click on a file" , ( ) => {
10
- cy . get ( "div" ) . contains ( "user1" ) . click ( ) ;
11
- cy . url ( ) . should ( "include" , "/user1" ) ;
10
+ cy . loginWithUrl ( "/file" ) ;
11
+ cy . get ( "div.col-md-4.col-7" ) . contains ( "Admin" ) . click ( ) ;
12
+ cy . url ( ) . should ( "include" , "/admin" ) ;
13
+ } ) ;
14
+
15
+ it ( "goes back to the home of the filesystem" , ( ) => {
16
+ cy . loginWithUrl ( "/file/admin" ) ;
17
+ cy . get ( "div" ) . contains ( "Home" ) . click ( ) ;
18
+ cy . url ( ) . should ( "not.include" , "/admin" ) ;
19
+ } ) ;
20
+
21
+ it ( "shows error message when a path does not exist" , ( ) => {
22
+ cy . loginWithUrl ( "/file/fghdhjghjdfhjhdfkhg/dfghjkhghjdfhj" ) ;
23
+ cy . get ( "div" ) . contains ( "Folder does not exist, or you are not allowed to see the folder." )
12
24
} ) ;
13
25
} ) ;
26
+
27
+
Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ describe('The Home Page', () => {
6
6
7
7
it ( 'sets auth cookie when logging in via form submission' , function ( ) {
8
8
// destructuring assignment of the this.currentUser object
9
- const username = 'user1 ' ;
10
- const password = '12345 ' ;
9
+ const username = 'admin ' ;
10
+ const password = 'admin ' ;
11
11
12
12
//cy.visit('/login')
13
13
Original file line number Diff line number Diff line change 11
11
//
12
12
// -- This is a parent command --
13
13
Cypress . Commands . add ( 'loginWithUrl' , ( path ) => {
14
- const user = { username :"user " , password :"1234 " }
14
+ const user = { username :"admin " , password :"admin " }
15
15
16
16
cy . visit ( path )
17
17
cy . get ( 'input[id=formBasicUsername]' )
You can’t perform that action at this time.
0 commit comments