From 2dcfb865a7b843729d4a97846c7a102e7ad08936 Mon Sep 17 00:00:00 2001 From: Elsa Mary Date: Mon, 4 Nov 2024 19:56:36 +0530 Subject: [PATCH] Modified cypress tests --- app/controllers/miq_ae_class_controller.rb | 34 +- .../components/miq-ae-class/index.jsx | 4 - .../miq-ae-class-form.spec.js | 22 -- app/views/miq_ae_class/_class_add.html.haml | 2 +- app/views/miq_ae_class/_class_form.html.haml | 41 +-- .../miq_ae_class/_class_form_new.html.haml | 7 - app/views/miq_ae_class/_class_props.html.haml | 2 +- .../Embedded-Automate/Explorer/class.cy.js | 314 ++++-------------- 8 files changed, 77 insertions(+), 349 deletions(-) delete mode 100644 app/views/miq_ae_class/_class_form_new.html.haml diff --git a/app/controllers/miq_ae_class_controller.rb b/app/controllers/miq_ae_class_controller.rb index 2803807fe25..c7751289d04 100644 --- a/app/controllers/miq_ae_class_controller.rb +++ b/app/controllers/miq_ae_class_controller.rb @@ -12,8 +12,6 @@ class MiqAeClassController < ApplicationController MIQ_AE_COPY_ACTIONS = %w[miq_ae_class_copy miq_ae_instance_copy miq_ae_method_copy].freeze - require 'byebug' - # GET /automation_classes # GET /automation_classes.xml def index @@ -465,7 +463,6 @@ def edit_class end set_form_vars @hide_bottom_bar = true - # have to get name and set node info, to load multiple tabs correctly # rec_name = get_rec_name(@ae_class) # get_node_info("aec-#{@ae_class.id}") @@ -484,9 +481,7 @@ def edit_class_record @hide_bottom_bar = true class_rec = MiqAeClass.find(params[:id]) - # if class_rec.default - # add_flash(_("Default Class \"%{name}\" can not be edited") % {:name => class_rec.name}, :error) - # end + render :json => { :fqname => class_rec.fqname, :name => class_rec.name, @@ -1319,7 +1314,6 @@ def new @ae_class = MiqAeClass.new set_form_vars @hide_bottom_bar = true - @in_a_form = true replace_right_cell end @@ -1883,16 +1877,7 @@ def class_update_create case params[:button] when "add", "save" class_rec = params[:id].blank? ? MiqAeClass.new : MiqAeClass.find(params[:id]) # Get new or existing record - - # add_flash(_("Fully Qualified Name"), :error) if params[:fqname].blank? add_flash(_("Name is required"), :error) if params[:name].blank? - # add_flash(_("Display Name is required"), :error) if params[:display_name].blank? - - # if @flash_array - # javascript_flash - # return - # end - # class_rec.relative_path = params[:fqname] class_rec.name = params[:name] class_rec.display_name = params[:display_name] class_rec.description = params[:description] @@ -1907,34 +1892,17 @@ def class_update_create javascript_flash else edit_hash = {} - # edit_hash[:new] = {:relative_path => params[:fqname], :name => params[:name], - # :display_name => params[:display_name], :description => params[:description]} - edit_hash[:new] = {:name => params[:name], :display_name => params[:display_name], :description => params[:description]} - if params[:old_data] - # edit_hash[:current] = {:relative_path => params[:old_data][:fqname], :name => params[:old_data][:name], - # :display_name => params[:old_data][:display_name], - # :description => params[:old_data][:description]} - edit_hash[:current] = {:name => params[:old_data][:name], :display_name => params[:old_data][:display_name], :description => params[:old_data][:description]} else - # edit_hash[:current] = {:relative_path => nil, :name => nil, :display_name => nil, :description => nil} edit_hash[:current] = {:name => nil, :display_name => nil, :description => nil} end AuditEvent.success(build_saved_audit(class_rec, edit_hash)) @edit = session[:edit] = nil # clean out the saved info - # if editing from list view then change active_node to be same as updated image_type folder node - # if x_node.split('-')[0] == "xx" - # self.x_node = "xx-MiqDialog_#{dialog.dialog_type}" - # elsif params[:button] == "add" - # d = MiqDialog.find_by(:name => dialog.name, :dialog_type => dialog.dialog_type) - # self.x_node = "odg-#{d.id}" - # end - # get_node_info replace_right_cell(:nodetype => x_node, :replace_trees => [:ae]) end end diff --git a/app/javascript/components/miq-ae-class/index.jsx b/app/javascript/components/miq-ae-class/index.jsx index 671850fcdde..d0cd9ea9052 100644 --- a/app/javascript/components/miq-ae-class/index.jsx +++ b/app/javascript/components/miq-ae-class/index.jsx @@ -15,7 +15,6 @@ const MiqAeClass = ({ classRecord, fqname }) => { const isEdit = !!(classRecord && classRecord.id); useEffect(() => { - debugger if (isEdit) { http.get(`/miq_ae_class/edit_class_record/${classRecord.id}/`).then((recordValues) => { if (recordValues) { @@ -38,7 +37,6 @@ const MiqAeClass = ({ classRecord, fqname }) => { const params = { action: isEdit ? 'edit' : 'create', - // fqname: fqname, name: values.name, display_name: values.display_name, description: values.description, @@ -147,7 +145,6 @@ const FormTemplate = ({ MiqAeClass.propTypes = { classRecord: PropTypes.shape({ id: PropTypes.number, - // fqname: PropTypes.string, name: PropTypes.string, display_name: PropTypes.string, description: PropTypes.string, @@ -161,7 +158,6 @@ MiqAeClass.defaultProps = { FormTemplate.propTypes = { formFields: PropTypes.arrayOf( PropTypes.shape({ id: PropTypes.number }), - // PropTypes.shape({ fqname: PropTypes.string }), PropTypes.shape({ name: PropTypes.string }), PropTypes.shape({ display_name: PropTypes.string }), PropTypes.shape({ description: PropTypes.string }), diff --git a/app/javascript/spec/miq-ae-class-form/miq-ae-class-form.spec.js b/app/javascript/spec/miq-ae-class-form/miq-ae-class-form.spec.js index a38fe264824..8e369f9327b 100644 --- a/app/javascript/spec/miq-ae-class-form/miq-ae-class-form.spec.js +++ b/app/javascript/spec/miq-ae-class-form/miq-ae-class-form.spec.js @@ -20,12 +20,6 @@ describe('MiqAeClass Form Component', () => { description: 'test description', }; - // const MiqAeClassCopyData = { - // name: 'test copy', - // display_name: 'test display name', - // description: 'test copy description', - // }; - const fqName = 'Sample FQ Name'; afterEach(() => { @@ -65,20 +59,4 @@ describe('MiqAeClass Form Component', () => { }); }); }); - - // it('should render copy class form correctly', async() => { - // const wrapper = shallow(); - // fetchMock.get(`/miq_ae_customization/old_dialogs_copy?&expand=resources`, customizationMockData); - - // await new Promise((resolve) => { - // setImmediate(() => { - // wrapper.update(); - // expect(toJson(wrapper)).toMatchSnapshot(); - // resolve(); - // }); - // }); - // }); }); diff --git a/app/views/miq_ae_class/_class_add.html.haml b/app/views/miq_ae_class/_class_add.html.haml index f3fb75addb6..3cadb3e84d8 100644 --- a/app/views/miq_ae_class/_class_add.html.haml +++ b/app/views/miq_ae_class/_class_add.html.haml @@ -1,4 +1,4 @@ #add_class_props_div - if @in_a_form_fields && x_node.split('-')[0] == "aec" || params[:pressed] || %w(field_select field_accept field_delete).include?(params[:action]) #form_div - = render :partial => "class_form_new" + = render :partial => "class_form" diff --git a/app/views/miq_ae_class/_class_form.html.haml b/app/views/miq_ae_class/_class_form.html.haml index 5d3d9bc3808..a3e5041d203 100644 --- a/app/views/miq_ae_class/_class_form.html.haml +++ b/app/views/miq_ae_class/_class_form.html.haml @@ -1,35 +1,6 @@ -- url = url_for_only_path(:action => 'form_field_changed', :id => (@ae_class.id || 'new')) -- obs = {:interval => '.5', :url => url}.to_json -%h3 - = _('Properties') -.form-horizontal - .form-group - %label.col-md-2.control-label - = _('Fully Qualified Name') - .col-md-8 - = @sb[:namespace_path] - .form-group - %label.col-md-2.control-label - = _('Name') - .col-md-8 - = text_field_tag("name", @edit[:new][:name], - :maxlength => ViewHelper::MAX_NAME_LEN, - :class => "form-control", - "data-miq_observe" => obs) - = javascript_tag(javascript_focus('name')) - .form-group - %label.col-md-2.control-label - = _('Display Name') - .col-md-8 - = text_field_tag("display_name", @edit[:new][:display_name], - :maxlength => ViewHelper::MAX_NAME_LEN, - :class => "form-control", - "data-miq_observe" => obs) - .form-group - %label.col-md-2.control-label - = _('Description') - .col-md-8 - = text_field_tag("description", @edit[:new][:description], - :maxlength => ViewHelper::MAX_NAME_LEN, - :class => "form-control", - "data-miq_observe" => obs) +- if @ae_class + - if @in_a_form + = react('MiqAeClass', + :classRecord => @ae_class, + :fqname => @sb[:namespace_path]) + diff --git a/app/views/miq_ae_class/_class_form_new.html.haml b/app/views/miq_ae_class/_class_form_new.html.haml deleted file mode 100644 index b633bc85c9b..00000000000 --- a/app/views/miq_ae_class/_class_form_new.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -- if @ae_class - - if @in_a_form - = react('MiqAeClass', - :classRecord => @ae_class, - :fqname => @sb[:namespace_path]) --# if @ae_class && !@in_a_form --# = miq_ae_customization_summary(@ae_class) diff --git a/app/views/miq_ae_class/_class_props.html.haml b/app/views/miq_ae_class/_class_props.html.haml index 1b947a064a3..20d53d71db3 100644 --- a/app/views/miq_ae_class/_class_props.html.haml +++ b/app/views/miq_ae_class/_class_props.html.haml @@ -6,4 +6,4 @@ - else #form_div %div{:style => "padding-top: 10px;"} - = render :partial => "class_form_new" + = render :partial => "class_form" diff --git a/cypress/e2e/ui/Automation/Embedded-Automate/Explorer/class.cy.js b/cypress/e2e/ui/Automation/Embedded-Automate/Explorer/class.cy.js index 19bc839711a..b0efc0e63eb 100644 --- a/cypress/e2e/ui/Automation/Embedded-Automate/Explorer/class.cy.js +++ b/cypress/e2e/ui/Automation/Embedded-Automate/Explorer/class.cy.js @@ -9,7 +9,7 @@ describe('Automation > Embedded Automate > Explorer', () => { }); afterEach(() => { - // Remove Domain + // Remove Domain after each tests cy.get('[title="Datastore"]').click({force: true}); cy.get('[title="Automate Domain: TestDomain"]').click({force: true}); cy.get('[title="Configuration"]').click({force: true}); @@ -20,285 +20,107 @@ describe('Automation > Embedded Automate > Explorer', () => { describe('Class Form', () => { - it('Creates a Domain', () => { - // creates Domain + it('Creates and edits an automate class', () => { + // Creates a Domain cy.get('[title="Datastore"]').click({force: true}); cy.get('[title="Configuration"]').click({force: true}); cy.get('[title="Add a New Domain"]').click({force: true}); cy.get('[name="name"]').type('TestDomain'); cy.get('[name="description"]').type('This is a test domain'); cy.get('#enabled').check(); - cy.get('[class="bx--btn bx--btn--primary"]').contains('Add').click({force: true}); - - // // check correct data is displaying - // cy.get('.bx--data-table-content tbody tr') - // .last() - // .should('contain', 'Automate Domain: TestDomain'); - // // .and('contain', 'This is a test domain'); - - // creates Namespace + cy.get('[class="bx--btn bx--btn--primary"]').contains('Add').click(); // submits Domain + // checks for the success message + cy.get('div.alert.alert-success.alert-dismissable') + .should('exist') + .and('contain', 'Automate Domain "TestDomain" was added') + .find('button.close').should('exist'); + + // Creates a Namespace cy.get('[title="Datastore"]').click({force: true}); - cy.get('[title="Automate Domain: TestDomain"]').click({force: true}); + cy.get('[title="Automate Domain: TestDomain"]').click({force: true}); // clicks on Domain cy.get('[title="Configuration"]').click({force: true}); cy.get('[title="Add a New Namespace"]').click({force: true}); cy.get('[name="name"]').type('TestNS'); cy.get('[name="description"]').type('This is a test NS'); - cy.get('.bx--btn--primary') - .contains('Add') - // .should('be.visible') - .click(); + cy.get('.bx--btn--primary').contains('Add').click(); // submits Namespace - // // check correct data is displaying - // cy.get('.bx--data-table-content tbody tr') - // .last() - // .should('contain', 'Automate Namespace: TestNS'); - // // .and('contain', 'This is a test NS'); - - // creates Class + // Creates a Class cy.get('[title="Datastore"]').click({force: true}); - cy.get('[title="Automate Domain: TestDomain"]').click({force: true}); - cy.get('[title="Automate Namespace: TestNS"]').click({force: true}); + cy.get('[title="Automate Domain: TestDomain"]').click({force: true}); // clicks on Domain + cy.get('[title="Automate Namespace: TestNS"]').click({force: true}); // clicks on Namespace cy.get('[title="Configuration"]').click({force: true}); cy.get('[title="Add a New Class"]').click({force: true}); cy.get('[name="name"]').type('TestClass'); cy.get('[name="display_name"]').type('TC'); cy.get('[name="description"').type('This is a test class desc'); - cy.get('.bx--btn--primary') - .contains('Add') - // .should('be.visible') - .click(); + cy.get('.bx--btn--primary').contains('Add').click(); // submits class + // checks for the success message + cy.get('#flash_msg_div .alert.alert-success').should('exist') + .and('be.visible').and('contain', 'Class "TestClass" was added'); - // // check correct data is displaying - // cy.get('.bx--data-table-content tbody tr') - // .last() - // .should('contain', 'TestClass') - // .and('contain', 'TC') - // .and('contain', 'This is a test class desc'); - - // edits a class - cy.get('[title="Automate Class: TC (TestClass)"]').click({force: true}); + // Edits a class + cy.get('[title="Automate Class: TC (TestClass)"]').click({force: true}); // clicks on the class cy.get('[title="Configuration"]').click({force: true}); cy.get('[title="Edit this Class"]').click({force: true}); cy.get('[name="display_name"]').clear({force: true}); - // cy.get('[name="display_name"]').clear({force: true}); // need to clear twice cy.get('[name="display_name"]').type('Edited TC', {force: true}); cy.get('[name="description"').clear({force: true}); cy.get('[name="description"').type('Edited Test Class Description'); cy.get('[class="btnRight bx--btn bx--btn--primary"]').contains('Save').click({force: true}); - - // check it updated - // Navigate to the Properties tab - cy.get('#props_tab a').click(); - - cy.get('div.label_header:contains("Name")') - .siblings('.content_value') - .should('contain', 'TestClass'); - cy.get('div.label_header:contains("Display Name")') - .siblings('.content_value') - .should('contain', 'Edited TC'); - cy.get('div.label_header:contains("Description")') - .siblings('.content_value') - .should('contain', 'Edited Test Class Description'); - - // Clicks the cancel button during class create + // Checks if class data was updated + cy.get('#props_tab a').click(); // Navigate to the Properties tab + cy.get('div.label_header:contains("Name")').siblings('.content_value') + .should('contain', 'TestClass'); + cy.get('div.label_header:contains("Display Name")').siblings('.content_value') + .should('contain', 'Edited TC'); + cy.get('div.label_header:contains("Description")').siblings('.content_value') + .should('contain', 'Edited Test Class Description'); + + // Clicks the Cancel button during class creation cy.get('[title="Datastore"]').click({force: true}); cy.get('[title="Automate Domain: TestDomain"]').click({force: true}); cy.get('[title="Automate Namespace: TestNS"]').click({force: true}); cy.get('[title="Configuration"]').click({force: true}); cy.get('[title="Add a New Class"]').click({force: true}); - - cy.get('[class="bx--btn bx--btn--secondary"]').contains('Cancel').click({force: true}); + cy.get('[class="bx--btn bx--btn--secondary"]') + .contains('Cancel').click({force: true}); // clicks Cancel button cy.get('[id="explorer_title_text"]').contains('Automate Namespace "TestNS"'); - // // Remove class - // cy.get('[title="Datastore"]').click({force: true}); - // cy.get('[title="Automate Domain: TestDomain"]').click({force: true}); - // cy.get('[title="Configuration"]').click({force: true}); - // cy.get('[title="Remove this Domain"]').click({force: true}); + // Clicks the Cancel button during class update + cy.get('[title="Automate Class: Edited TC (TestClass)"]').click({force: true}); // clicks on the class + cy.get('[title="Configuration"]').click({force: true}); + cy.get('[title="Edit this Class"]').click({force: true}); + cy.get('[name="description"]').clear({force: true}); + cy.get('[name="description"]').type('New description for class', {force: true}); + cy.get('[class="bx--btn bx--btn--secondary"]').contains('Cancel').click({force: true}); + // Checks if class data was updated + cy.get('#props_tab a').click(); // Navigate to the Properties tab + cy.get('div.label_header:contains("Description")').siblings('.content_value') + .should('not.contain', 'New description for class') + .should('contain', 'Edited Test Class Description'); + + // Clicks the Reset button during class update + cy.get('[title="Automate Class: Edited TC (TestClass)"]').click({force: true}); // clicks on the class + cy.get('[title="Configuration"]').click({force: true}); + cy.get('[title="Edit this Class"]').click({force: true}); + cy.get('[name="description"]').clear({force: true}); + cy.get('[name="description"]').type('New description for class', {force: true}); + cy.get('[class="btnRight bx--btn bx--btn--secondary"]').contains('Reset').click({force: true}); + // Check for the flash message div + cy.get('#flash_msg_div .alert.alert-warning').should('exist') + .and('be.visible').and('contain', 'All changes have been reset'); + // Checks if class data was updated + cy.get('[name="description"]').should('have.value', 'Edited Test Class Description'); + cy.get('[class="bx--btn bx--btn--secondary"]').contains('Cancel').click({force: true}); - // cy.get('.bx--data-table-content tbody tr').should('not.contain', 'Automate Domain: TestDomain'); + // Removes class + cy.get('[title="Automate Class: Edited TC (TestClass)"]').click({force: true}); // clicks on the class + cy.get('[title="Configuration"]').click({force: true}); + cy.get('[title="Remove this Class"]').click({force: true}); + // checks for the success message + cy.get('div.alert.alert-success.alert-dismissable') + .should('exist') + .and('contain', 'Automate Class "TestClass": Delete successful'); }); - - // creates Namespace - // it('Creates a Namespace', () => { - - // }); - - // it('Clicks the cancel button', () => { - // cy.get('[title="TestNS"]').click({force: true}); - // cy.get('[title="Configuration"]').click({force: true}); - // cy.get('[title="Add a New Class"]').click({force: true}); - // cy.get('[class="bx--btn bx--btn--secondary"]').contains('Cancel').click({force: true}); - // cy.get('[id="explorer_title_text"]').contains('Automate Namespace "TestNS"'); - // }); - - // creates Class - // it('Creates a Class', () => { - - - // }); - - // // edits a class - // cy.get('[title="Automate Class: Test class (C1)"]').click({force: true}); - // cy.get('[title="Configuration"]').click({force: true}); - // cy.get('[title="Edit this Class"]').click({force: true}); - // cy.get('[name="display_name"]').clear({force: true}); - // // cy.get('[name="display_name"]').clear({force: true}); // need to clear twice - // cy.get('[name="display_name"]').type('Edited Test Class', {force: true}); - // cy.get('[name="description"').clear({force: true}); - // cy.get('[name="description"').type('Edited Test Description'); - // cy.get('[class="btnRight bx--btn bx--btn--secondary"]').contains('Reset').click({force: true}); - - // // check it was reset - // cy.get('[name="name"]').should('have.value', 'C2'); - // cy.get('[name="display_name"]').should('have.value', 'Test Class'); - // cy.get('[name="description"]').should('have.value', 'Test Description'); - // cy.get('[class="bx--btn bx--btn--secondary"]').contains('Cancel').click({force: true}); - - // it('Clicks on a sample Class', () => { - // cy.get('[title="Automate Class: Test class (C1)"]').click({force: true}); - // cy.get('[id="props_tab"]').click({force: true}); - // cy.get('.content_value object_item bx--structured-list-td').contains('/ ZiraatTeknoloji / DropDowns / VMware / C1'); - // }); - - // it('Resets a class being edited', () => { - // // creates a class - // cy.get('[title="Automate Namespace: VMware"]').click({force: true}); - // cy.get('[title="Configuration"]').click({force: true}); - // cy.get('[title="Add a New Class"]').click({force: true}); - // cy.get('[name="name"]').type('C2'); - // cy.get('[name="display_name"]').type('Test Class'); - // cy.get('[name="description"').type('Test Description'); - // cy.get('[class="btnRight bx--btn bx--btn--primary"]').click({force: true}); - - // // check correct data is displaying - // cy.get('.bx--data-table-content tbody tr') - // .last() - // .should('contain', 'C2') - // .and('contain', 'Test Class') - // .and('contain', 'Test Description'); - - // // edits a class - // cy.get('[title="Automate Class: Test class (C1)"]').click({force: true}); - // cy.get('[title="Configuration"]').click({force: true}); - // cy.get('[title="Edit this Class"]').click({force: true}); - // cy.get('[name="display_name"]').clear({force: true}); - // // cy.get('[name="display_name"]').clear({force: true}); // need to clear twice - // cy.get('[name="display_name"]').type('Edited Test Class', {force: true}); - // cy.get('[name="description"').clear({force: true}); - // cy.get('[name="description"').type('Edited Test Description'); - // cy.get('[class="btnRight bx--btn bx--btn--secondary"]').contains('Reset').click({force: true}); - - // // check it was reset - // cy.get('[name="name"]').should('have.value', 'C2'); - // cy.get('[name="display_name"]').should('have.value', 'Test Class'); - // cy.get('[name="description"]').should('have.value', 'Test Description'); - // cy.get('[class="bx--btn bx--btn--secondary"]').contains('Cancel').click({force: true}); - - // // Remove class - // cy.get('[title="Configuration"]').click({force: true}); - // cy.get('[title="Remove this Class"]').click({force: true}); - // cy.get('.bx--data-table-content tbody tr') - // .last() - // .should('not.contain', 'C2') - // .and('not.contain', 'Test Class') - // .and('not.contain', 'Test Description'); - // }); - - // it('Creates, edits, deletes a dialog', () => { - // // creates a dialog - // cy.get('[title="Configuration"]').click({force: true}); - // cy.get('[title="Add a new Dialog"]').click({force: true}); - // cy.get('[name="name"]').type('Test User'); - // cy.get('[name="description"').type('Test Description'); - // cy.get('[name="dialog_type"]').select('Configured System Provision'); - // cy.get('[class="CodeMirror-lines"]').type(':Buttons:'); - // cy.get('[class="btnRight bx--btn bx--btn--primary"]').click({force: true}); - - // // check correct data is displaying - // // cy.get('[id="main_div"]').contains('Test Description'); - // cy.contains('Test Description').click({force: true}); - // cy.get('.miq_ae_customization_summary').contains('Test User'); - // cy.get('.miq_ae_customization_summary').contains('Test Description'); - // cy.get('[class="CodeMirror-code"]').contains('---'); - // cy.get('[class="CodeMirror-code"]').contains(':Buttons:'); - - // // edits a dialog - // cy.get('[title="Configuration"]').click({force: true}); - // cy.get('[title="Edit this Dialog"]').click({force: true}); - // cy.get('[name="name"]').clear({force: true}); - // cy.get('[name="name"]').clear({force: true}); // need to clear twice - // cy.get('[name="name"]').type('Edited Test User', {force: true}); - // cy.get('[name="description"').clear({force: true}); - // cy.get('[name="description"').type('Edited Test Description'); - // cy.get('[name="dialog_type"]').select('Physical Server Provision'); - // cy.get('[class="CodeMirror-lines"]').type('\n :submit:\n:cancel:'); - // cy.get('[class="btnRight bx--btn bx--btn--primary"]').click({force: true}); - // cy.get('[class="col-md-12"]').contains('Edited Test Description'); - - // // check correct data after editing - // cy.contains('Edited Test Description').click({force: true}); - // cy.get('.miq_ae_customization_summary').contains('Edited Test User'); - // cy.get('.miq_ae_customization_summary').contains('Edited Test Description'); - // cy.get('[class="CodeMirror-code"]').contains('---'); - // cy.get('[class="CodeMirror-code"]').contains(':Buttons:'); - // cy.get('[class="CodeMirror-code"]').contains(':submit:'); - // cy.get('[class="CodeMirror-code"]').contains(':cancel:'); - - // // check correct data after copying - // cy.contains('Edited Test Description').click({force: true}); - // cy.get('.miq_ae_customization_summary').contains('Edited Test Description'); - // cy.get('[class="CodeMirror-code"]').contains('---'); - // cy.get('[class="CodeMirror-code"]').contains(':Buttons:'); - // cy.get('[class="CodeMirror-code"]').contains(':submit:'); - // cy.get('[class="CodeMirror-code"]').contains(':cancel:'); - - // cy.contains('Edited Test Description').click({force: true}); - // cy.get('[title="Configuration"]').click({force: true}); - // cy.get('[title="Remove this Dialog"]').click({force: true}); - - // cy.get('[class="list-group"]').should('not.contain', 'Test Description'); - // }); - - // it('Creates, copies, and deletes a dialog', () => { - // // creates a dialog - // cy.get('[title="Configuration"]').click({force: true}); - // cy.get('[title="Add a new Dialog"]').click({force: true}); - // cy.get('[name="name"]').type('Test User'); - // cy.get('[name="description"').type('Test Description'); - // cy.get('[name="dialog_type"]').select('Configured System Provision'); - // cy.get('[class="CodeMirror-lines"]').type(':Buttons:'); - // cy.get('[class="btnRight bx--btn bx--btn--primary"]').click({force: true}); - // cy.get('[class="col-md-12"]').contains('Test Description'); - - // // check correct data is displaying - // cy.contains('Test Description').click({force: true}); - // cy.get('.miq_ae_customization_summary').contains('Test User'); - // cy.get('.miq_ae_customization_summary').contains('Test Description'); - // cy.get('[class="CodeMirror-code"]').contains('---'); - // cy.get('[class="CodeMirror-code"]').contains(':Buttons:'); - - // // copies a dialog - // cy.get('[title="Configuration"]').click({force: true}); - // cy.get('[title="Copy this Dialog"]').click({force: true}); - // cy.get('[class="btnRight bx--btn bx--btn--primary"]').click({force: true}); - // cy.get('[class="col-md-12"]').contains('Test Description'); - - // cy.contains('Test Description').click({force: true}); - - // // clean up - // cy.get('[title="Configuration"]').click({force: true}); - // cy.get('[title="Remove this Dialog"]').click({force: true}); - - // cy.get('[id="explorer_title_text"]').contains('Configured System Provision Dialogs'); - // cy.get('[class="list-group"]').contains('Test Description').should('be.visible').click({force: true}); - // cy.get('[id="main_div"]').contains('Copy of Test User'); - // cy.get('[id="main_div"]').contains('Test Description'); - // cy.get('[class="CodeMirror-code"]').contains('---'); - // cy.get('[title="Configuration"]').click({force: true}); - // cy.get('[title="Remove this Dialog"]').click({force: true}); - - // cy.get('[class="list-group"]').should('not.contain', 'Test Description'); - // }); }); });