<h2><%= I18n.t(:new_project) %></h2>

<% if @error || params[:error]%>
    <div class="alert alert-warning"><%= @error ||  params[:error] %></div>
<% end %>

<script type="text/javascript" charset="utf-8">
	
	function trim(s){ 
	  return ( s || '' ).replace( /^\s+|\s+$/g, '' ); 
	}
		
  function set_identifier() {
    var entered_name = trim($("#name").val());
    if (!$("#identifier").val()) {
      var default_identifier = $.trim(entered_name.toLowerCase().replace(/ /g, '-'));
      $("#identifier").val(default_identifier);
    }
  }
  
  function set_project_identifier() {
    var entered_name = trim($("#project_name").val());
    if (!$("#project_identifier").val()) {
      var default_identifier = $.trim(entered_name.toLowerCase().replace(/ /g, '-'));
      $("#project_identifier").val(default_identifier);
    }
  }
  
  
  
  

  function set_identifier_2() {
    var entered_name = trim($("#project_name").val());
    if (!$("#project_identifier").val()) {
      var default_identifier = $.trim(entered_name.toLowerCase().replace(/ /g, '-'));
      $("#project_identifier").val(default_identifier);
    }
  }


  $(function () {
    $('#notifications-tabs a:first').tab('show');
  });

  function select_template() {
    if ($("#project_template").val() == "Ruby on Rails") {
      $("#new_db_migrate_task").show();
      $("#new_unit_test_task").show();
      $("#new_ui_test_dir").show();
      $("#new_ui_test_task").show();
      $("#ui_test_dir").val("test/acceptance")
    } else {
      $("#new_db_migrate_task").hide();
      $("#new_unit_test_task").hide();
      $("#ui_test_dir").val("")
    }
  }
	
	function fill_demo_rspec() {
		$("#main-test-build-step-wrap").show();
		$("#custom-build-steps-wrap").hide();		
		$("#builder-prepare-command").val("");
		
		$("#name").val("AgileTravel Sequential Build RSpec");
		$("#identifier").val("agiletravel-quick-build-rspec");
		<% if RUBY_PLATFORM =~ /mingw/ %>
		$("#project_dir").val("C:/work/buildwise-samples");
		<% else %>
		$("#project_dir").val("~/work/projects/buildwise-samples");		
		<% end %>
		$("#ui_test_dir").val("e2e-rspec-selenium/spec");
		$("#ui_test_report_dir").val("spec/reports");
		$("#main_testing_step_task").val("-f e2e-rspec-selenium/Rakefile ci:ui_tests:quick");
		$("#main_testing_step_framework").val("RSpec");
		$("#main_testing_step_name").val("UI Test");
		$("#is_load_testing").val("false");
		$("#is_performance_testing").val("false");
	}
	
	function fill_demo_python() {
		$("#main-test-build-step-wrap").show();
		$("#custom-build-steps-wrap").hide();		
		$("#builder-prepare-command").val("");
		
		$("#name").val("AgileTravel Sequential Build Python Unittest");
		$("#identifier").val("agiletravel-quick-build-python-unittest");
		<% if RUBY_PLATFORM =~ /mingw/ %>
		$("#project_dir").val("C:/work/buildwise-samples");
		<% else %>
		$("#project_dir").val("~/work/projects/buildwise-samples");		
		<% end %>
		$("#ui_test_dir").val("e2e-pytest-selenium/tests");
		$("#ui_test_report_dir").val("e2e-pytest-selenium/reports");
		$("#main_testing_step_task").val("-f e2e-pytest-selenium/Rakefile ci:ui_tests:quick");
		$("#main_testing_step_framework").val("unittest");						
		$("#main_testing_step_name").val("UI Test");
		$("#is_load_testing").val("false");
		$("#is_performance_testing").val("false");
	}
	
	function fill_demo_mocha() {
		$("#main-test-build-step-wrap").show();
		$("#custom-build-steps-wrap").hide();		
		$("#builder-prepare-command").val("cd e2e-mocha-selenium; npm install");
		
		$("#name").val("AgileTravel Sequential Build Mocha");
		$("#identifier").val("agiletravel-quick-build-mocha");
		<% if RUBY_PLATFORM =~ /mingw/ %>
		$("#project_dir").val("C:/work/buildwise-samples");
		<% else %>
		$("#project_dir").val("~/work/projects/buildwise-samples");		
		<% end %>
		$("#ui_test_dir").val("e2e-mocha-selenium/spec");
		$("#ui_test_report_dir").val("e2e-mocha-selenium/reports");
		// TODO: e2e-mocha-selenium; npm install
		$("#main_testing_step_task").val("-f e2e-mocha-selenium/Rakefile ci:ui_tests:quick");
		$("#main_testing_step_framework").val("Mocha");		
		$("#main_testing_step_name").val("UI Test");	
		$("#is_load_testing").val("false");
		$("#is_performance_testing").val("false");
	}

	
	function fill_demo_playwright_test() {
		$("#main-test-build-step-wrap").show();
		$("#custom-build-steps-wrap").hide();		
		$("#builder-prepare-command").val("cd e2e-playwright-test-refactored; npm install");
		
		$("#name").val("AgileTravel Sequential Build Playwright Test");
		$("#identifier").val("agiletravel-quick-build-playwright-test");
		<% if RUBY_PLATFORM =~ /mingw/ %>
		$("#project_dir").val("C:/work/buildwise-samples");
		<% else %>
		$("#project_dir").val("~/work/projects/buildwise-samples");		
		<% end %>
		$("#ui_test_dir").val("e2e-playwright-test-refactored/tests");
		$("#ui_test_report_dir").val("e2e-playwright-test-refactored/reports");
		// TODO: e2e-mocha-selenium; npm install
		$("#main_testing_step_task").val("-f e2e-playwright-test-refactored/Rakefile ci:ui_tests:quick");
		$("#main_testing_step_framework").val("PlaywrightTest");		
		$("#main_testing_step_name").val("UI Test");	
		$("#is_load_testing").val("false");
		$("#is_performance_testing").val("false");
	}
  
	
	function fill_demo_playwright_pytest() {
		$("#main-test-build-step-wrap").show();
		$("#custom-build-steps-wrap").hide();		
		$("#builder-prepare-command").val("cd e2e-pytest-playwright;");
		
		$("#name").val("AgileTravel Sequential Build Playwright pyest");
		$("#identifier").val("agiletravel-quick-build-playwright-pytest");
		<% if RUBY_PLATFORM =~ /mingw/ %>
		$("#project_dir").val("C:/work/buildwise-samples");
		<% else %>
		$("#project_dir").val("~/work/projects/buildwise-samples");		
		<% end %>
		$("#ui_test_dir").val("e2e-pytest-playwright/tests");
		$("#ui_test_report_dir").val("e2e-pytest-playwright/reports");
		// TODO: e2e-mocha-selenium; npm install
		$("#main_testing_step_task").val("-f e2e-pytest-playwright/Rakefile ci:ui_tests:quick");
		$("#main_testing_step_framework").val("pytest");		
		$("#main_testing_step_name").val("UI Test");	
		$("#is_load_testing").val("false");
		$("#is_performance_testing").val("false");
	}
	
	
	function fill_demo_cucumber() {
		$("#main-test-build-step-wrap").show();
		$("#custom-build-steps-wrap").hide();		
		$("#builder-prepare-command").val("");
		
		$("#name").val("AgileTravel Sequential Build Cucumber");
		$("#identifier").val("agiletravel-quick-build-cucumber");
		<% if RUBY_PLATFORM =~ /mingw/ %>
		$("#project_dir").val("C:/work/buildwise-samples");
		<% else %>
		$("#project_dir").val("~/work/projects/buildwise-samples");		
		<% end %>
		$("#ui_test_dir").val("e2e-cucumber-selenium/features");
		$("#ui_test_report_dir").val("e2e-cucumber-selenium/log");
		$("#main_testing_step_task").val("-f e2e-cucumber-selenium/Rakefile ci:ui_tests:quick");
		$("#main_testing_step_framework").val("Cucumber");		
		$("#main_testing_step_name").val("UI Test");	
		$("#is_load_testing").val("false");
		$("#is_performance_testing").val("false");
	}
	

	function fill_typical_rspec() {
		$("#main-test-build-step-wrap").show();
		$("#custom-build-steps-wrap").hide();		
		$("#builder-prepare-command").val("");
		
		$("#name").val("My UI Tests");
		$("#identifier").val("");
		<% if RUBY_PLATFORM =~ /mingw/ %>
		$("#project_dir").val("C:/work/my-ui-tests");
		<% else %>
		$("#project_dir").val("~/work/my-ui-tests");		
		<% end %>
		$("#ui_test_dir").val("spec");
		$("#ui_test_report_dir").val("spec/reports");
		$("#main_testing_step_task").val("-f Rakefile ci:ui_tests:quick");
		$("#main_testing_step_framework").val("RSpec");
		$("#main_testing_step_name").val("UI Test");		            
		$("#is_load_testing").val("false");
		$("#is_performance_testing").val("false");
	}
	
	
	function fill_demo_performance_testing_mechanize() {
		$("#main-test-build-step-wrap").show();
		$("#custom-build-steps-wrap").hide();		
		$("#builder-prepare-command").val("");
			
		$("#name").val("AgileTravel Performance Testing (Mechanize)");
		$("#identifier").val("agiletravel-performance-mechanize");
		<% if RUBY_PLATFORM =~ /mingw/ %>
		$("#project_dir").val("C:/work/buildwise-samples");
		<% else %>
		$("#project_dir").val("~/work/projects/buildwise-samples");		
		<% end %>
		$("#ui_test_dir").val("performance-rspec-mechanize/spec");
		$("#ui_test_report_dir").val("performance-rspec-mechanize/reports");
		$("#main_testing_step_task").val("-f performance-rspec-mechanize/Rakefile ci:performance_tests");
		$("#main_testing_step_framework").val("RSpec");		
		$("#main_testing_step_name").val("Performance Test");	
		$("#is_load_testing").val("false");
		$("#is_performance_testing").val("true");			    
	}

	function fill_demo_performance_testing_selenium() {
		$("#main-test-build-step-wrap").show();
		$("#custom-build-steps-wrap").hide();		
		$("#builder-prepare-command").val("");
		
		$("#name").val("AgileTravel Performance Testing (Selenium)");
		$("#identifier").val("agiletravel-performance-selenium");
		<% if RUBY_PLATFORM =~ /mingw/ %>
		$("#project_dir").val("C:/work/buildwise-samples");
		<% else %>
		$("#project_dir").val("~/work/projects/buildwise-samples");		
		<% end %>
		$("#ui_test_dir").val("performance-rspec-selenium/spec");
		$("#ui_test_report_dir").val("performance-rspec-selenium/reports");
		$("#main_testing_step_task").val("-f performance-rspec-selenium/Rakefile ci:performance_tests");
		$("#main_testing_step_framework").val("RSpec");		
		$("#main_testing_step_name").val("Performance Test");	
		$("#is_load_testing").val("false");
		$("#is_performance_testing").val("true");			    
	}
	
	
	function fill_demo_load_testing() {
		$("#main-test-build-step-wrap").show();
		$("#custom-build-steps-wrap").hide();		
		$("#builder-prepare-command").val("");
		
	  $("#name").val("AgileTravel Load Testing Login");
		$("#identifier").val("agiletravel-load-testing-login");
		<% if RUBY_PLATFORM =~ /mingw/ %>
		$("#project_dir").val("C:/work/buildwise-samples");
		<% else %>
		$("#project_dir").val("~/work/projects/buildwise-samples");		
		<% end %>
		$("#ui_test_dir").val("load-rspec-selenium/load");
		$("#ui_test_report_dir").val("spec/reports");
		$("#load_test_task").val("-f load-rspec-selenium/Rakefile ci:load_tests:login");
		$("#main_testing_step_task").val("-f load-rspec-selenium/Rakefile ci:load_tests:login");
		$("#main_testing_step_framework").val("RSpec");
		$("#main_testing_step_name").val("Load Test");		        
		$("#is_load_testing").val("true");
		$("#is_performance_testing").val("false");
	    $("#load_server_url").val("https://travel.agileway.net");
	    $("#load_max_iteration_count").val("3");
	    $("#load_max_duration").val("2");
	    $("#app_name").val("AgileTravel-Load");
	}
	

	
	function fill_demo_api() {
		$("#main-test-build-step-wrap").show();
		$("#custom-build-steps-wrap").hide();		
		$("#builder-prepare-command").val("");
		
	  $("#name").val("API Testing Recipes in Ruby");
		$("#identifier").val("api-testing-ruby");
		<% if RUBY_PLATFORM =~ /mingw/ %>
		$("#project_dir").val("C:/work/buildwise-samples");
		<% else %>
		$("#project_dir").val("~/work/projects/buildwise-samples");		
		<% end %>
		$("#ui_test_dir").val("api-rspec/spec");
		$("#ui_test_report_dir").val("api-rspec/spec/reports");
		$("#main_testing_step_task").val("-f api-rspec/Rakefile ci:api_tests:quick");
		$("#main_testing_step_framework").val("RSpec");
		$("#main_testing_step_name").val("API Test");
		$("#is_load_testing").val("false");
		$("#is_performance_testing").val("false");
	}
	
	
	
	function fill_demo_ant() {
		$("#main-test-build-step-wrap").hide();
		$("#custom-build-steps-wrap").show();
		$("#builder-prepare-command").val("");
	
		$("#name").val("Ant JUnit5 (Java)");
		$("#identifier").val("ant-junit");
		<% if RUBY_PLATFORM =~ /mingw/ %>
		$("#project_dir").val("C:/work/buildwise-samples");
		<% else %>
		$("#project_dir").val("~/work/projects/buildwise-samples");		
		<% end %>
		$("#ui_test_report_dir").val("ant-junit/build/test-report");


		$("#custom_build_steps").html('[{"name":"Compile","builder":"ant","task":"-f ant-junit/build.xml clean compile","enabled":true,"test_framework":"JUnit","order":3},{"name":"Unit Testing","builder":"ant","task":"-f ant-junit/build.xml test.unit.console","enabled":true,"test_framework":"JUnit","order":4}]')
		
		
		$("#is_load_testing").val("false");
		$("#is_performance_testing").val("false");
	}
	
	function fill_testwisely_sample_performance() {
		$("#main-test-build-step-wrap").show();
		$("#custom-build-steps-wrap").hide();		
		$("#builder-prepare-command").val("");
		
		$("#name").val("Sample Performance");
		$("#identifier").val("sample-performance");
		$("#project_dir").val("~/work/projects/your_repository_folder_name");		
		$("#ui_test_dir").val("performance");
		$("#ui_test_report_dir").val("spec/reports");
		$("#main_testing_step_task").val("-f Rakefile ci:performance_tests");
		$("#main_testing_step_framework").val("RSpec");		
		$("#main_testing_step_name").val("Performance Test");	
		$("#is_load_testing").val("false");
		$("#is_performance_testing").val("true");			    
	}
	
	function fill_testwisely_sample_load() {
		$("#main-test-build-step-wrap").show();
		$("#custom-build-steps-wrap").hide();		
		$("#builder-prepare-command").val("");
		
	  $("#name").val("Sample Load Login");
		$("#identifier").val("sample-load-login");
		$("#project_dir").val("~/work/projects/your_repository_folder_name");		
		$("#ui_test_dir").val("load");
		$("#ui_test_report_dir").val("spec/reports");
		$("#load_test_task").val("-f Rakefile ci:load_tests:login");
		$("#main_testing_step_task").val("-f Rakefile ci:load_tests:login");
		$("#main_testing_step_framework").val("RSpec");
		$("#main_testing_step_name").val("Load Test");		        
		$("#is_load_testing").val("true");
		$("#is_performance_testing").val("false");
	    $("#load_server_url").val("https://your-server-host");
	    $("#load_max_iteration_count").val("3");
	    $("#load_max_duration").val("2");
	    $("#app_name").val("Your-App");
	}
  
  
	function fill_demo_ios() {
		$("#main-test-build-step-wrap").show();
		$("#custom-build-steps-wrap").hide();		
		$("#builder-prepare-command").val("");
		
		$("#name").val("Demo Appium iOS XCUITest RSpec Sequential");
		$("#identifier").val("demo-appium-ios-xcuitest-rspec-sequential");
		<% if RUBY_PLATFORM =~ /mingw/ %>
		$("#project_dir").val("C:/work/buildwise-samples");
		<% else %>
		$("#project_dir").val("~/work/projects/buildwise-samples");		
		<% end %>
		$("#ui_test_dir").val("e2e-rspec-appium-ios-xcuitest/spec");
		$("#ui_test_report_dir").val("spec/reports");
		$("#main_testing_step_task").val("-f e2e-rspec-appium-ios-xcuitest/Rakefile ci:ui_tests:quick");
		$("#main_testing_step_framework").val("RSpec");
		$("#main_testing_step_name").val("UI Test");
		$("#is_load_testing").val("false");
		$("#is_performance_testing").val("false");
	}
	
  
	function fill_demo_android() {
		$("#main-test-build-step-wrap").show();
		$("#custom-build-steps-wrap").hide();		
		$("#builder-prepare-command").val("");
		
		$("#name").val("Demo Appium Andriod UIAutomator2 RSpec Sequential");
		$("#identifier").val("demo-appium-android-uiautomator2-rspec-sequential");
		<% if RUBY_PLATFORM =~ /mingw/ %>
		$("#project_dir").val("C:/work/buildwise-samples");
		<% else %>
		$("#project_dir").val("~/work/projects/buildwise-samples");		
		<% end %>
		$("#ui_test_dir").val("e2e-rspec-appium-android-uiautomator2/spec");
		$("#ui_test_report_dir").val("spec/reports");
		$("#main_testing_step_task").val("-f e2e-rspec-appium-android-uiautomator2/Rakefile ci:ui_tests:quick");
		$("#main_testing_step_framework").val("RSpec");
		$("#main_testing_step_name").val("UI Test");
		$("#is_load_testing").val("false");
		$("#is_performance_testing").val("false");
	}
	
</script>

<div id="configure_auto">
	
		<div class="pull-right">
			
			<div class="dropdown" style="margin-right: 10px;">
  		      <button class="btn btn-sm btn-light dropdown-toggle" type="button" id="fill_demo" data-bs-toggle="dropdown" id="profile_dropdown" aria-expanded="false">
                <%= I18n.t(:fill_demo_project)%>
			    <span class="caret"></span>
			  </button>
			  <div class="dropdown-menu" aria-labelledby="fill_demo">
			    <a class="dropdown-item" href="#" onclick="fill_demo_rspec();">RSpec</a>
			    <a class="dropdown-item"  href="#" onclick="fill_demo_mocha();">Mocha (Node.js)</a>
			    <a class="dropdown-item" href="#" onclick="fill_demo_python();">unittest (Python)</a>
			    <a class="dropdown-item" href="#" onclick="fill_demo_playwright_pytest();">Playwright pytest (Python)</a>
			    <a class="dropdown-item" href="#" onclick="fill_demo_playwright_test();">Playwright Test (JS)</a>
			    <a class="dropdown-item" href="#" onclick="fill_demo_api();">API Testing (Ruby)</a>
			    <a class="dropdown-item" href="#" onclick="fill_demo_cucumber();">Cucumber</a>

			    <a class="dropdown-item" href="#" onclick="fill_typical_rspec();">Typical RSpec</a>
			    
          <div class="dropdown-divider"></div>          
          <a class="dropdown-item" href="#" onclick="fill_demo_android();">Appium Android UIAutomator2</a>
          <a class="dropdown-item" href="#" onclick="fill_demo_ios();">Appium iOS XCUITest</a>
                    
          <div class="dropdown-divider"></div>
			    <a class="dropdown-item" href="#" onclick="fill_demo_ant();">Apache Ant</a>

          <div class="dropdown-divider"></div>
			    <a class="dropdown-item" href="#" onclick="fill_demo_performance_testing_mechanize();">Performance Testing (mechanize)</a>
			    <a class="dropdown-item" href="#" onclick="fill_demo_performance_testing_selenium();">Performance Testing (selenium)</a>
			    <a class="dropdown-item" href="#" onclick="fill_demo_load_testing();">Load Testing (RSpec)</a>
          
          <div class="dropdown-divider"></div>
			    <a class="dropdown-item" href="#" onclick="fill_testwisely_sample_performance();">TestWisely Performance</a>
			    <a class="dropdown-item" href="#" onclick="fill_testwisely_sample_load();">TestWisely Load</a>

				</div>
			</div>			

		</div>
		
  <p><b>Option 1. Loading from a working folder</b> or
    <a href="#" onclick="$('#configure_auto').hide(); $('#configure_manually').show()">Specify manually</a>
		
	</p>
	
  <form method="POST" action="/projects" class='form-horizontal' id="new_project_form">
	  
	<input type="hidden" name="is_load_testing" id="is_load_testing" value="false"/>
	<input type="hidden" name="is_performance_testing" id="is_performance_testing" value="false"/>
	<input type="hidden" name="app_name" id="app_name" value=""/>

    <div class="form-group form-group-sm row">
      <label class="col-sm-2 form-control-label" for="contact_header"><%= I18n.t(:project_name)%>:</label>
      <div class="col-sm-5">
        <input type="text" id="name" name="name" onchange="set_identifier();" onfocusout="set_identifier()"  class="form-control" placeholder="Display name of the build project"/>
      </div>
    </div>
    <div class="form-group form-group-sm row">
      <label class="col-sm-2 form-control-label" for="contact_header"><%= I18n.t(:identifier)%>:</label>
      <div class="col-sm-9">
        <input type="text" id="identifier" name="identifier" class="form-control form-control-inline" style="width: 50%"/>
        <span class="instruction"> (lower case and unique, e.g. whenwise-ui-tests)</span>
      </div>
    </div>
    <div class="form-group form-group-sm row">
      <label class="col-sm-2 form-control-label" for="contact_header"><%= I18n.t(:working_folder)%>:</label>
      <div class="col-sm-9">
        <input type="text" name="project_dir" id="project_dir" class="form-control"/>
        <div class="instruction">(Specify the SCM checked out project folder on the machine running BuildWise server, e.g. <% if RUBY_PLATFORM =~ /mingw/%><code>c:/myworkdir</code><% else %><code>/home/you/work</code><% end%>. 
				BuildWise will try to use the working git's origin URL as the repository URL, can be changed later along with the project working folder under <code>~/.buildwise</code>).
				</div>
      </div>
    </div>

<!-- 
    <div class="form-group form-group-sm row">
      <label class="col-sm-2 form-control-label" for="contact_header">SCM Login: </label>
      <div class="col-sm-10">
        <table border="0" cellspacing="0" cellpadding="0" width="75%">
          <tr>
            <td><input type="text" name="scm_user" class="form-control" placeholder="username"/></td>
            <td width="30">&nbsp;</td>
            <td><input type="password" name="scm_pass" class="form-control" placeholder="password"/></td>
          </tr>
        </table>
        <div class="instruction">(You may want to use dedicated user for CI, if you have set up SSH without login or embed user:password in Git config URL, ignore this.)</div>
      </div>
    </div>
		
    <div class="form-group form-group-sm row">
      <label class="col-sm-2 form-control-label" for="contact_header">Project Template: </label>
      <div class="col-sm-4">
        <select id="project_template" name="project_template" onchange='select_template(this);' class="form-control">
          <option>- Select -</option>
          <option selected="true">Continuous Test Server</option>
          <option>Ruby on Rails</option>
        </select>
      </div>
    </div>

-->

    <div class="form-group form-group-sm row">
      <label class="col-sm-2 form-control-label" for="contact_header"><%= I18n.t(:ui_test_folder) %>:</label>
      <div class="col-sm-9">
        <input type="text" id="ui_test_dir" name="ui_test_dir" value="" size="40" class="form-control"/>
        <div class="instruction">(where the UI tests are, relative to the project root directory, eg. <b>spec</b> or <b>ui-tests/spec</b>)</div>
      </div>
    </div>

      <div class="form-group form-group-sm row">
	      <label class="col-sm-2 form-control-label" for="contact_header">Test results folder:</label>
				
        <div class="col-sm-9">
          <input type="text" name="ui_test_report_dir" id="ui_test_report_dir"  class="form-control" value="" placeholder="relative path, e.g. spec/reports"/>
          <div class="instruction hint hint-below">
            The directory (relative path) contains generated JUnit style test reports (<i>TEST-XXX.xml</i>), such as
            <code>spec/reports</code> or <code>log</code>. The output of test reports is set by Rakefile. This setting
            is for Sequential Build only.
          </div>
        </div>
      </div>
			
    <div class="form-group form-group-sm row" id="new_db_migrate_task" style="display:none;">
      <label class="col-sm-2 form-control-label" for="contact_header">Rake task for database migration:</label>
      <div class="col-sm-6">
        <input type="text" name="migrate_database_task" value="RAILS_ENV=test db:migrate" class="form-control"/>
      </div>
    </div>

    <div class="form-group form-group-sm row" id="new_unit_test_task" style="display:none;">
      <label class="col-sm-2 form-control-label" for="contact_header">Rake task for unit tests:</label>
      <div class="col-sm-6">
        <input type="text" name="unit_test_task" value="RAILS_ENV=test test" size="40" class="form-control"/>
      </div>
    </div>

    <div class="form-group form-group-sm row" id="main-test-build-step-wrap">
      <label class="col-sm-2 form-control-label" for="contact_header"><%= I18n.t(:rake_task_for_main_testing) %>:</label>
      <div class="col-sm-6">

        <input type="hidden" id="load_test_task" name="load_test_task" value=""/>
        <input type="hidden" id="load_server_url" name="load_server_url" value=""/>
        <input type="hidden" id="load_max_iteration_count" name="load_max_iteration_count" value=""/>
        <input type="hidden" id="load_max_duration" name="load_max_duration" value=""/>

        <input type="text" id="main_testing_step_task" name="main_testing_step_task" value="" class="form-control"/>
        <div class="instruction">(The task executing long-running blackbox automated tests, i.e. UI/API/Load tests, <!--the most important and challenging step in Agile/Devops. --> e.g. <b>ci:ui_tests:quick</b>. You may configure this later.)</div>
      </div>
      <div class="col-sm-4" style="text-align:right; padding-right: 9.5%;">
        <div>
					Test framework: 
				
					<select id="main_testing_step_framework" name="main_testing_step_framework" style="width: 150px;">
						<option value="RSpec">RSpec (Ruby)</option>
						<option value="Cucumber">Cucumber (Ruby)</option>
						<option value="Mocha"%>Mocha (JavaScript)</option>
						<option value="pytest"%>pytest (Python)</option>
						<option value="unittest"%>unittest (Python)</option>
						<option value="PlaywrightTest"%>Playwright Test (JS)</option>
						<option value="JUnit"%>JUnit Ant (Java)</option>
						<option value="VSTest"%>VSTest (C#)</option>
					</select>	        	
					
        </div>
        <div style="margin-top: 10px;">
          <%= I18n.t(:testing_step_name)%>:
          <input type="text" id="main_testing_step_name" name="main_testing_step_name" value="UI Test" size="20" style="border:1px solid #ced4da; font-weight: 400; font-size: 13px; padding: 5px;"/>          
        </div>
      </div>
    </div>


    <div class="form-group form-group-sm row" id="custom-build-steps-wrap" style="display:none;">
      <label class="col-sm-2 form-control-label" for="contact_header"><%= I18n.t(:build_steps) %>:</label>
      <div class="col-sm-9">
		  <textarea id="custom_build_steps" name="custom_build_steps_json" class="form-control" rows="4"></textarea>
      </div>
    </div>
	
	<input type="hidden" id="builder-prepare-command" name="builder_prepare_command" value=""/>
	

    <div class="form-group row" style="margin-bottom: 8px;">
      <label class="col-sm-2 form-control-label">&nbsp; </label>
      <div class=" col-sm-9">
				<input class="btn btn-primary" value="<%= I18n.t(:create)%>" id="create_project_btn" type="submit" 
			  <% if RACK_ENV == 'showcase'%>disabled="true"<% end %>
			 			  data-toggle="tooltip" data-placement="bottom" title="<% if RACK_ENV == 'showcase'%>Disabled for ShowCase mode<% else %>Save the project settings<% end %>"
				/>
        <a href="/" class="btn btn-default"><%= I18n.t(:cancel)%></a>
      </div>
    </div>
  </form>

</div>


<div id="configure_manually" style="display:none">
  <p><b>Option 2. Configure Manually</b> or
    <a href="#" onclick="$('#configure_manually').hide();$('#configure_auto').show();">load from working folder then
      customize</a></p>

  <% form_tag "/projects", method: "post", class: "form-horizontal" do %>
<div>
  <p><b class="section-heading">Project Name</b></p>
  <div class="config-section-content">


    <div class="form-group form-group-sm row">
      <label class="col-sm-2 form-control-label" for="contact_header">Name:</label>
      <div class="col-sm-5">
		  
		  <input type="text" id="project_name" name="project[name]" onchange="set_project_identifier();" class="form-control" placeholder="DisplDispayay name of the build project"/>
        </select>
      </div>
    </div>

    <div class="form-group form-group-sm row">
      <label class="col-sm-2 form-control-label" for="contact_header">Identifier:</label>
      <div class="col-sm-5">
        <input type="text" id="project_identifier" name="project[identifier]" class="form-control form-control-inline"/>
        <div class="instruction">(lower case and unique, e.g. adminwise-ui-tests)</div>
      </div>
    </div>
	
  </div>
</div>

	
    <%= partial(:'projects/form', :locals => {:project => Project.new}) %>

    <div class="form-group row">
      <label class="col-sm-2 form-control-label">&nbsp; </label>
      <div class=" col-sm-9">
								<input class="btn btn-primary" value="Create" id="create_project_manually_btn" type="submit" 
			  <% if RACK_ENV == 'showcase'%>disabled="true"<% end %>
			 			  data-toggle="tooltip" data-placement="bottom" title="<% if RACK_ENV == 'showcase'%>Disabled for ShowCase mode<% else %>Save the project settings<% end %>"
				/>
        <a href="/" class="btn btn-default"><%= I18n.t(:cancel)%></a>
      </div>
    </div>

   <% end %>
</div>
