@@ -18,7 +18,7 @@ describe('Code Snippet tests', () => {
1818 const snippetName = 'test-code-snippet' ;
1919
2020 beforeEach ( ( ) => {
21- cy . openJupyterLab ( ) ;
21+ cy . resetJupyterLab ( ) ;
2222 openCodeSnippetExtension ( ) ;
2323 } ) ;
2424
@@ -36,8 +36,6 @@ describe('Code Snippet tests', () => {
3636 cy . get (
3737 '.elyra-metadata .elyra-metadataHeader-button[title="Create new Code Snippet"]'
3838 ) . should ( 'be.visible' ) ;
39- // Close metadata editor tab
40- cy . closeCurrentTab ( ) ;
4139 } ) ;
4240
4341 it ( 'should provide warnings when required fields are not entered properly' , ( ) => {
@@ -53,9 +51,6 @@ describe('Code Snippet tests', () => {
5351 'required-warnings'
5452 ) ;
5553 cy . get ( '@required-warnings' ) . should ( 'have.length' , 2 ) ;
56-
57- // Close metadata editor tab
58- cy . closeCurrentTab ( ) ;
5954 } ) ;
6055
6156 it ( 'should create valid code-snippet' , ( ) => {
@@ -339,21 +334,6 @@ const saveAndCloseMetadataEditor = (): void => {
339334 cy . get ( '.elyra-metadataEditor-saveButton > button:visible' ) . click ( ) ;
340335} ;
341336
342- // const fillMetadaEditorForm = (snippetName: string): void => {
343- // // Name code snippet
344- // cy.get('.elyra-metadataEditor-form-display_name').type(snippetName);
345-
346- // // Select python language from dropdown list
347- // editSnippetLanguage(snippetName, 'Python');
348-
349- // // Add snippet code
350- // cy.get('.elyra-metadataEditor-code > .bp3-form-content').type(
351- // 'print("Code Snippet Test")'
352- // );
353-
354- // saveAndCloseMetadataEditor();
355- // };
356-
357337const deleteSnippet = ( snippetName : string ) : void => {
358338 // Find element by name
359339 const item = getSnippetByName ( snippetName ) ;
@@ -374,19 +354,6 @@ const getActionButtonsElement = (snippetName: string): any => {
374354 return actionButtonsElement ;
375355} ;
376356
377- // const deleteFileByType = (type: string): void => {
378- // cy.getFileByType(type).rightclick();
379- // cy.get('.p-Menu-content > [data-command="filebrowser:delete"]').click();
380- // cy.get('.jp-mod-accept > .jp-Dialog-buttonLabel:visible').click();
381- // cy.wait(100);
382- // };
383-
384- // const checkCodeMirror = (): void => {
385- // cy.get('span.cm-string')
386- // .first()
387- // .contains('Code Snippet Test');
388- // };
389-
390357const insert = ( snippetName : string ) : void => {
391358 getActionButtonsElement ( snippetName ) . within ( ( ) => {
392359 cy . get ( 'button[title="Insert"]' ) . click ( ) ;
@@ -403,8 +370,3 @@ const editSnippetLanguage = (snippetName: string, lang: string): void => {
403370 . contains ( `${ lang } ` )
404371 . click ( ) ;
405372} ;
406-
407- // const closeTabWithoutSaving = (): void => {
408- // cy.closeCurrentTab();
409- // cy.get('button.jp-mod-accept.jp-mod-warn').click();
410- // };
0 commit comments