diff --git a/Gemfile b/Gemfile index faefa6b..ac01061 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,8 @@ gem 'rails', '4.0.2' gem 'bcrypt-ruby', '3.1.2' # Use sqlite3 as the database for Active Record -gem 'sqlite3' +#gem 'sqlite3' +gem 'pg' # Use SCSS for stylesheets gem 'sass-rails', '~> 4.0.0' diff --git a/Gemfile.lock b/Gemfile.lock index e9a8742..258d920 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -90,6 +90,7 @@ GEM mime-types (1.25.1) minitest (4.7.5) multi_json (1.8.2) + pg (0.14.1-x86-mingw32) polyglot (0.3.3) rack (1.5.2) rack-protection (1.5.2) @@ -151,7 +152,6 @@ GEM actionpack (>= 3.0) activesupport (>= 3.0) sprockets (~> 2.8) - sqlite3 (1.3.8-x86-mingw32) temple (0.6.7) thin (1.6.1) daemons (>= 1.0.9) @@ -189,6 +189,7 @@ DEPENDENCIES haml-rails jbuilder (~> 1.2) jquery-rails + pg rails (= 4.0.2) sass-rails (~> 4.0.0) sdoc @@ -196,7 +197,6 @@ DEPENDENCIES sidekiq (~> 2.17.0) sinatra slim - sqlite3 thin turbolinks twitter-bootstrap-rails diff --git a/app/assets/stylesheets/custom.css.scss b/app/assets/stylesheets/custom.css.scss index d663c23..b6c52de 100644 --- a/app/assets/stylesheets/custom.css.scss +++ b/app/assets/stylesheets/custom.css.scss @@ -97,6 +97,9 @@ #tab-content .label-success, .badge-success { background-color: #468847; } +#tab-content .label-fail { + background-color: #B94A48; +} #tab-content .label { border-radius: 3px; } @@ -140,3 +143,15 @@ word-wrap: break-word; } +/* Error Modal */ +#imageModal { + width: 80%; + height: 80%; + margin-left: 10%; + left: 0; + text-align: center; +} +#imageModal img { + width: 90%; + height: 90%; +} \ No newline at end of file diff --git a/app/controllers/menus_controller.rb b/app/controllers/menus_controller.rb index 80708cf..0dd87bc 100644 --- a/app/controllers/menus_controller.rb +++ b/app/controllers/menus_controller.rb @@ -2,7 +2,10 @@ class MenusController < ApplicationController before_action :signed_in_user, except: :welcome def home @user_id = current_user.id - render 'home.html.haml' + respond_to do |wants| + wants.html { render 'home.html.haml' } + end + end private def signed_in_user diff --git a/app/controllers/old_sel_scripts_in_controller.rb b/app/controllers/old_sel_scripts_in_controller.rb deleted file mode 100644 index b1f6b0d..0000000 --- a/app/controllers/old_sel_scripts_in_controller.rb +++ /dev/null @@ -1,170 +0,0 @@ - LOGIN_REPORT_PATH = 'C:\seleniumscripts\APA\public\reports\login_ts' - MESSAGES_REPORT_PATH = 'C:\seleniumscripts\APA\public\reports\message_ts' - def index - @lts_td_count=LoginTestData.count - end - - def lts_show - @log_report_name=DateTime.now.strftime("%Y%m%d%H%M%S")+".html" - @td=LoginTestData.all - @result=Array.new - @td.each do |data| - # Passing test data to login function - @result<< login(data.email,data.password,data.check) - end - # Creating log file - log_file("#{LOGIN_REPORT_PATH}\\#{@log_report_name}",@result) - render 'lts_summary' - end - - def mts_msg_fetch_show - @log_report_name=DateTime.now.strftime("%Y%m%d%H%M%S")+".html" - @td=LoginTestData.find_by check: true - @result=Array.new - # Passing test data to login function - @result=messages_fetch(@td.email,@td.password) - - # Creating log file - log_file("#{MESSAGES_REPORT_PATH}\\#{@log_report_name}",@result) - render 'mts_summary' - end - - private - # Function to create log files - def log_file(file_name,result) - File.open(file_name, 'w+') do |f| - f.puts "

Created at #{DateTime.now.strftime("%Y%m%d%H%M%S")}

- - - - - - - " - cnt=0 - result.each do |res| - if (res.include? "Pass")==true then - f.puts "" - else - f.puts "" - end - f.puts "" - end - f.puts "
Test Suite -
S.NoTest Case NoStatus
#{cnt+=1}TC00#{cnt}#{res}
" - end - end - - # Functions for fetching - def fByid(element,query) - return element.find_element(:id,query) - end - - def fByxpath(element,query) - return element.find_element(:xpath,query) - end - - - def fByname(element,query) - return element.find_element(:name,query) - end - - # Login Suite - # Testing Login Functionality with Valid/Invalid Credentials - def login(email, password, check) - - driver = Selenium::WebDriver.for :firefox - wait = Selenium::WebDriver::Wait.new(timeout:10) - - # Accessing base site - driver.get 'http://www.ourgoalplan.com' - - user_name_element=fByname(driver,"txtName") - password_element=fByname(driver,"txtPassword") - - # Testing for element presence - wait.until { - user_name_element.displayed? - } - wait.until { - password_element.displayed? - } - - # Attempting login - user_name_element.send_keys(email) - password_element.send_keys(password) - user_name_element.send_keys :return - - if check==true then - wait.until {fByxpath(driver,"/html/body/form/table/tbody/tr/td/img").displayed?} - if driver.page_source.include? email - driver.quit - return "Pass: Correct Credentials" - else - driver.quit - return "Fail: Correct Credentials" - end - else - wait.until {fByname(driver,"txtName").displayed?} - if /Invalid/.match(driver.page_source) - driver.quit - return "Pass: Incorrect Credentials" - else - driver.quit - return "Fail: Incorrect Credentials" - end - end - - driver.quit - end - - # Message Suite - # Fetching all the messages - def messages_fetch(username,password) - begin - driver = Selenium::WebDriver.for :firefox - wait = Selenium::WebDriver::Wait.new(timeout:10) - # Accessing base site - driver.get 'http://www.ourgoalplan.com' - main_window = driver.window_handle - - user_name_element=fByname(driver,"txtName") - password_element=fByname(driver,"txtPassword") - - # Testing for login element presence - wait.until { - user_name_element.displayed? - } - wait.until { - password_element.displayed? - } - - # Attempting login - user_name_element.send_keys(username) - password_element.send_keys(password) - user_name_element.send_keys :return - - wait.until {fByxpath(driver,'//*[@id="ucGPSMenu_hlnkMessage"]').displayed?} - - msg_link=fByxpath(driver,'//*[@id="ucGPSMenu_hlnkMessage"]') - - msg_link.send_keys :return - - wait.until {fByxpath(driver,'/html/body/form/div[5]/div[2]/div/div[2]/div/div/table/tbody/tr[2]/td').displayed?} - cell_text=fByxpath(driver,'/html/body/form/div[5]/div[2]/div/div[2]/div/div/table/tbody/tr[2]/td').text - - # Fetching all the messages - @i=1 - @result_set=[] - while cell_text do - @i+=1 - if fByxpath(driver,'/html/body/form/div[5]/div[2]/div/div[2]/div/div/table/tbody/tr['+"#{@i}"+']/td').displayed? then - @result_set << fByxpath(driver,'/html/body/form/div[5]/div[2]/div/div[2]/div/div/table/tbody/tr['+"#{@i}"+']/td').text - end - end - rescue - false - end - driver.quit - return @result_set - end \ No newline at end of file diff --git a/app/controllers/queue_cart_controller.rb b/app/controllers/queue_cart_controller.rb index 2361710..ada642a 100644 --- a/app/controllers/queue_cart_controller.rb +++ b/app/controllers/queue_cart_controller.rb @@ -1,83 +1,112 @@ class QueueCartController < ApplicationController - before_action :signed_in_user - - def add_ts - @queue = QueueCart.new(post_params) - - respond_to do |wants| - if @queue.save - flash[:notice] = 'Queue was successfully created.' - wants.html { redirect_to(@queue) } - wants.js { render '' } - else - wants.js { render '' } - end - end - end + before_action :signed_in_user + + def show_pending + @jobs = Job.where('user_id = ? and status != ?', current_user.id, "Finished").to_a + respond_to do |wants| + wants.html { } + wants.js { render 'queue_cart/show_pending.js.haml' } + end + end - def show - @queues = QueueCart.all - @user_id = current_user.id - respond_to do |wants| - wants.html { } - wants.js { render 'queue_cart/show.js.haml' } - end - end + def show_processed + @jobs = Job.where(user_id: current_user.id, status: 'Finished') + respond_to do |wants| + wants.html { } + wants.js { } + end + end - def view_report - @reports = Execution.where(user_id: current_user.id).group("name").order(created_at: :desc) - respond_to do |wants| - wants.html { } - wants.js { } - end - end + def reports + @reports = Report.select('max(reports.id), reports.name, max(created_at) as last_run, max(job_id) as job_id').where(user_id: current_user.id).group('name').order('last_run DESC').to_a + respond_to do |wants| + wants.html { } + wants.js { } + end + end - def show_report - @executions = Execution.where(user_id: current_user.id, name: params[:name]) - @steps = Array.new - @final_status = "Pass" - @executions.each do |e| - @steps.push TestStep.find(e.test_step_id) - if e.status == "Fail" then @final_status="Fail" end - end - end + def show_report + @job = Job.find(params[:job_id]) + @reports = Report.where(job_id: @job.id, user_id: current_user.id).order('created_at') + @test_suite = TestSuite.find(@job.test_suite_id) + @test = Test.find(@job.test_id) + @final_status = "Pass" + @reports.each do |rep| + if rep.status == 'Fail' + @final_status = "Fail" + end + end + end - def exec_sel - @user_id = current_user.id - @exec_id = params[:exec_id] - @exec_id.each do |ex| - @execution = QueueCart.find(ex) - if @execution.test_step_id - ExecProgress.create(queue_id: @execution.id,user_id: @user_id, test_step_id: @execution.test_step_id, status: 'Start') - TestStepWorker.perform_async(@execution.test_step_id,@user_id) - else - ExecProgress.create(queue_id: @execution.id,user_id: @user_id, test_id: @execution.test_id, status: 'Start') - TestWorker.perform_async(@execution.test_id, @user_id) - end - end - respond_to do |wants| - wants.html { } - wants.js { } - end - end + def delete_report + # To do + end - def exec_all - # To do - end + def view_error + @job = Job.find(params[:job_id]) + @description = params[:desc] + @user_name = current_user.email + @file_name = @job.id.to_s + "_error.png" + end - def destroy - @queue = QueueCart.find(params[:id]).delete - flash.now[:success] = "Job removed from queue!" - respond_to do |wants| - wants.js { } - end - end + def execute + + if params[:commit]=="Execute Selected" then + @job_ids = params[:job_id] + @job_ids.each do |id| + @job = Job.find(id) + @job.update_attributes(status: 'Started') + if @job.test_step_id + #TestStepWorker.perform_async(@job.test_step_id,@user_id) + else + TestWorker.perform_async(@job.id) + end + end + else + @job_ids = Array.new + @jobs = Job.where(user_id: current_user.id, status: 'Pending').to_a + @jobs.each do |job| + @job_ids.push job.id + job.update_attributes(status: 'Started') + if job.test_step_id + #TestStepWorker.perform_async(job.test_step_id,@user_id) + else + TestWorker.perform_async(job.id) + end + end + end + respond_to do |wants| + wants.js { } + end + end - private - def signed_in_user - redirect_to root_url, notice:"Please Sign In" unless signed_in? - end - def post_params - params.require(:queue_cart).permit(:test_suite_id,:test_step_id,:test_id) - end + def destroy + @job_id = params[:id] + if Job.find(params[:id]).delete + flash.now[:success] = "Job removed from queue!" + else + flash.now[:error] = "Unexpected error occurred!" + end + respond_to do |wants| + wants.js { } + end + end + + def destroy_all + @user_id = current_user.id + @jobs = Job.where(user_id: @user_id).to_a + Job.delete_all(user_id: @user_id) + flash.now[:success] = "All Jobs removed from queue!" + respond_to do |wants| + wants.js { } + end + end + + private + def signed_in_user + redirect_to root_url, notice:"Please Sign In" unless signed_in? + end + def post_params + params.require(:queue_cart).permit(:test_suite_id,:test_step_id,:test_id) + end end diff --git a/app/controllers/sel_config_controller_old.rb b/app/controllers/sel_config_controller_old.rb deleted file mode 100644 index 2a5f7ea..0000000 --- a/app/controllers/sel_config_controller_old.rb +++ /dev/null @@ -1,59 +0,0 @@ -class SelConfigController < ApplicationController - before_action :signed_in_user - - def index - @sel_config=SelConfig.find_by_user_id(current_user.id) - end - def show - end - def new - if SelConfig.find_by_user_id(current_user.id).nil? - @sel_config=SelConfig.new - else - @sel_config=SelConfig.find_by_user_id(current_user.id) - end - end - def create - if SeleniumConfig.find_by_user_id(current_user.id).nil? - @sel_config=SelConfig.new - else - @sel_config=SelConfig.find_by_user_id(current_user.id) - end - @sel_config.update_attributes(new_config_params) - if @sel_config.save - @sel_config.update_attribute(:user_id,current_user.id) - @sel_config.save - flash.now[:success]="Configuration Saved!" - respond_to do |format| - format.js { render 'index.js.haml'} - end - else - respond_to do |format| - format.js { render 'new.js.haml'} - end - end - end - def edit - @sel_config=SelConfig.find_by_user_id(current_user.id) - end - - def update - @sel_config=SelConfig.find_by_user_id(current_user.id) - respond_to do |format| - if @sel_config.update(new_config_params) - flash.now[:success] = 'Configuration was successfully updated.' - format.js { render 'index.js.haml'} - else - format.html { render action: 'edit' } - format.js { render 'fail_create.js.haml' } - end - end - end - private - def signed_in_user - redirect_to root_url, notice:"Please Sign In" unless signed_in? - end - def new_config_params - params.require(:sel_config).permit(:browser, :url, :user_id) - end -end diff --git a/app/controllers/test_data_management_controller.rb b/app/controllers/test_data_management_controller.rb index 79cb589..0a1b31c 100644 --- a/app/controllers/test_data_management_controller.rb +++ b/app/controllers/test_data_management_controller.rb @@ -1,20 +1,3 @@ class TestDataManagementController < ApplicationController - def index - @login_td=LoginTestData.new - end - def create_login_td - @login_td=LoginTestData.create(post_params) - if @login_td.save then - flash[:success]="Login Test Data Created Successfully!" - redirect_to test_data_management_path - else - render 'index' - end - end - - private - def post_params - params.require(:login_test_data).permit(:email, :password, :check) - end end diff --git a/app/controllers/test_steps_controller.rb b/app/controllers/test_steps_controller.rb index 0a6b6f4..24f187f 100644 --- a/app/controllers/test_steps_controller.rb +++ b/app/controllers/test_steps_controller.rb @@ -89,6 +89,8 @@ def update_function @functions["Select a Function"]="" @web_element=WebElement.where(object_repository_id: @or,element_name:@el, page_name:@pg).first case @web_element.element_type + when 'Text' + @functions["Assert"]="Assert" when 'Text Box' @functions["Enter Value"]="Enter Value" when 'Select Box' @@ -110,7 +112,7 @@ def load_test @test = Test.find(params[:test_id]) @test_suite = @test.test_suite @or_options={} - ObjectRepository.all.each {|o| @or_options[o.name] = o.id} + ObjectRepository.where(user_id: current_user.id).to_a.each {|o| @or_options[o.name] = o.id} end def test_step_params params.require(:test_step).permit(:step_name, :step_description, :expected, :object_repository_id, :page_name, :element_id, :value, :function) diff --git a/app/controllers/test_suites_controller.rb b/app/controllers/test_suites_controller.rb index 533d25a..c521e87 100644 --- a/app/controllers/test_suites_controller.rb +++ b/app/controllers/test_suites_controller.rb @@ -1,6 +1,7 @@ class TestSuitesController < ApplicationController before_action :load_test_suite, except: :exec_test before_action :signed_in_user + def new @test_suite = TestSuite.new respond_to do |wants| @@ -8,6 +9,7 @@ def new wants.js { } end end + def show @test_suite=TestSuite.find(params[:id]) @tests=@test_suite.tests @@ -16,10 +18,12 @@ def show wants.js {} end end + def index @test_suite=TestSuite.new @test_suites=TestSuite.where(:user_id => current_user.id).to_a end + def create @test_suite=TestSuite.new(new_ts_params) if @test_suite.save then @@ -36,6 +40,7 @@ def create end end end + def edit @test_suite = TestSuite.find(params[:id]) respond_to do |wants| @@ -43,6 +48,7 @@ def edit wants.js {} end end + def update @test_suite=TestSuite.find(params[:id]) if @test_suite.update(new_ts_params) @@ -71,9 +77,9 @@ def destroy def add_tc @test = Test.find(params[:test_id]) @test_suite_id = @test.test_suite_id - @queue_tc = QueueCart.new(test_suite_id: @test_suite_id, test_id: @test.id) + @job = Job.new(user_id: current_user.id,test_suite_id: @test_suite_id, test_id: @test.id, status: "Pending") respond_to do |wants| - if @queue_tc.save + if @job.save flash.now[:success]="Test Case \'#{@test.name}\' added to Job queue!" wants.js {} else diff --git a/app/controllers/tests_controller.rb b/app/controllers/tests_controller.rb index 2b09d53..08b7ccf 100644 --- a/app/controllers/tests_controller.rb +++ b/app/controllers/tests_controller.rb @@ -1,6 +1,7 @@ class TestsController < ApplicationController before_action :load_test_suite, except: [:exec_test_step, :add_ts] before_action :signed_in_user + def new @test = @test_suite.tests.new respond_to do |wants| @@ -8,6 +9,7 @@ def new wants.js {} end end + def show @test=@test_suite.tests.find(params[:id]) @test_steps=@test.test_steps @@ -16,6 +18,7 @@ def show wants.js { render 'show.js.haml' } end end + def index if @test_suite.tests.size>0 then respond_to do |wants| @@ -30,6 +33,7 @@ def index end end end + def create @test = @test_suite.tests.new(test_params) if @test.save @@ -47,12 +51,14 @@ def create end end + def edit @test = @test_suite.tests.find(params[:id]) respond_to do |format| format.js { } end end + def update @test = @test_suite.tests.find(params[:id]) respond_to do |format| @@ -85,12 +91,16 @@ def destroy end end end + + def copy + # To Do + end def add_ts @test_step = TestStep.find(params[:test_step_id]) @test_id = @test_step.test_id @test_suite_id = Test.find(@test_id).test_suite_id - @queue_ts = QueueCart.new(test_suite_id: @test_suite_id, test_id: @test_id, test_step_id: @test_step.id) + @queue_ts = Job.new(user_id: current_user.id,test_suite_id: @test_suite_id, test_id: @test_id, test_step_id: @test_step.id, status: "Pending") respond_to do |wants| if @queue_ts.save flash.now[:success]="Test Step \'#{@test_step.step_name}\' added to Job queue!" @@ -105,8 +115,8 @@ def add_ts def exec_test_step @test_step_id = params[:test_step_id] @user_id = current_user.id - @exec = ExecProgress.create(user_id: @user_id, test_step_id: @test_step_id, status: 'Start') - TestStepWorker.perform_async(@test_step_id,@user_id) + #@exec = ExecProgress.create(user_id: @user_id, test_step_id: @test_step_id, status: 'Start') + #TestStepWorker.perform_async(@test_step_id,@user_id) respond_to do |wants| wants.html { } wants.js { render 'summary.js.haml' } @@ -118,8 +128,8 @@ def signed_in_user end def load_test_suite @test_suite = TestSuite.find(params[:test_suite_id]) - @tests=@test_suite.tests.all.to_a - @test_suites=TestSuite.all + @tests = @test_suite.tests.all.to_a + @test_suites = TestSuite.all end def test_params params.require(:test).permit(:name, :description) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 2277201..836c1e7 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -16,6 +16,9 @@ def show # GET /users/new def new @user = User.new + respond_to do |wants| + wants.js { } + end end # GET /users/1/edit @@ -29,12 +32,11 @@ def create respond_to do |format| if @user.save - format.html { + format.js { sign_in @user - redirect_to home_path } else - format.html { render action: 'new' } + format.js { } end end end diff --git a/app/helpers/queue_cart_helper.rb b/app/helpers/queue_cart_helper.rb deleted file mode 100644 index 1e5fa82..0000000 --- a/app/helpers/queue_cart_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module QueueCartHelper -end diff --git a/app/helpers/sel_config_helper.rb b/app/helpers/sel_config_helper.rb deleted file mode 100644 index 49ddad7..0000000 --- a/app/helpers/sel_config_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module SelConfigHelper -end diff --git a/app/models/exec_progress.rb b/app/models/exec_progress.rb deleted file mode 100644 index 570d071..0000000 --- a/app/models/exec_progress.rb +++ /dev/null @@ -1,2 +0,0 @@ -class ExecProgress < ActiveRecord::Base -end diff --git a/app/models/execution.rb b/app/models/execution.rb deleted file mode 100644 index 6ba5e52..0000000 --- a/app/models/execution.rb +++ /dev/null @@ -1,2 +0,0 @@ -class Execution < ActiveRecord::Base -end diff --git a/app/models/job.rb b/app/models/job.rb new file mode 100644 index 0000000..a4e10a2 --- /dev/null +++ b/app/models/job.rb @@ -0,0 +1,2 @@ +class Job < ActiveRecord::Base +end diff --git a/app/models/login_test_data.rb b/app/models/login_test_data.rb deleted file mode 100644 index 14d8813..0000000 --- a/app/models/login_test_data.rb +++ /dev/null @@ -1,5 +0,0 @@ -class LoginTestData < ActiveRecord::Base - validates :email, presence: true - validates :password, presence: true - #validates :check, presence: true -end diff --git a/app/models/queue_cart.rb b/app/models/queue_cart.rb deleted file mode 100644 index fec6782..0000000 --- a/app/models/queue_cart.rb +++ /dev/null @@ -1,2 +0,0 @@ -class QueueCart < ActiveRecord::Base -end diff --git a/app/models/report.rb b/app/models/report.rb new file mode 100644 index 0000000..2216896 --- /dev/null +++ b/app/models/report.rb @@ -0,0 +1,2 @@ +class Report < ActiveRecord::Base +end diff --git a/app/models/user.rb b/app/models/user.rb index 219d883..30f0856 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -11,7 +11,8 @@ class User < ActiveRecord::Base validates :password, length: { minimum: 6 } has_one :selenium_config - after_create :create_report_dir + has_many :queue_carts + after_create :create_error_dir def User.new_remember_token SecureRandom.urlsafe_base64 @@ -21,9 +22,9 @@ def User.encrypt(token) Digest::SHA1.hexdigest(token.to_s) end - def create_report_dir + def create_error_dir dir = self.email.to_s - Dir.mkdir("./public/reports/"+dir) unless File.exists?(dir) + Dir.mkdir("./public/errors/"+dir) unless File.exists?("./public/errors/"+dir) end private diff --git a/app/views/layouts/_flash.html.haml b/app/views/layouts/_flash.html.haml index 30871fc..cf3d235 100644 --- a/app/views/layouts/_flash.html.haml +++ b/app/views/layouts/_flash.html.haml @@ -2,4 +2,4 @@ - flash.each do |name, msg| %div{:class => "alert alert-#{name}"} %button.close{"data-dismiss" => "alert", :type => "button"} × - = msg + = msg \ No newline at end of file diff --git a/app/views/layouts/_navigation.html.haml b/app/views/layouts/_navigation.html.haml index cd99ae2..e1ee11c 100644 --- a/app/views/layouts/_navigation.html.haml +++ b/app/views/layouts/_navigation.html.haml @@ -19,11 +19,7 @@ .container-fluid.nav-collapse %ul.nav.pull-right - if signed_in? - - if ExecProgress.all.size==0 - %li= link_to raw(""), '#', :'data-toggle' => 'tooltip', title: "No Jobs in Progress", id: 'status' - - else - %li - %a= image_tag 'executing.gif', :'data-toggle' => 'tooltip', title: "Job Run in Progress", id: 'status' + %li= link_to raw(""), '#', :'data-toggle' => 'tooltip', title: "No Jobs in Progress", id: 'status' %li= link_to raw(""), '#', id:'notification', :'data-toggle' => 'tooltip', title: 'Notification' %li= link_to raw(""), signout_path, :'data-toggle' => "tooltip", :title => "Sign Out" %li= link_to raw(" #{current_user.email}"), '#', :'data-toggle' => 'tooltip', :title => "Logged in as #{current_user.email}" @@ -35,6 +31,6 @@ }); }); - else - %li#signup= link_to "Sign Up", signup_path + %li#signup= link_to "Sign Up", signup_path, remote: true %li#signin= link_to "Sign In", signin_path, remote: true \ No newline at end of file diff --git a/app/views/menus/home.html.haml b/app/views/menus/home.html.haml index 1293c0c..1907121 100644 --- a/app/views/menus/home.html.haml +++ b/app/views/menus/home.html.haml @@ -1,7 +1,12 @@ -.well.well-large - %h4 Welcome to SeRa - %div You can start by: - %ul - %li Defining Configuration Settings - %li Creating & defining Object Repositories - %li Creating Test Suites +#main-area + .well.well-large + %h4 Welcome to SeRa + %div You can start by: + %ul + %li Defining Configuration Settings + %li Creating & defining Object Repositories + %li Creating Test Suites + %li Defining Test steps and functions + %li Queuing tests for execution + %li Executing tests + %li Analyzing test results \ No newline at end of file diff --git a/app/views/menus/welcome.html.haml b/app/views/menus/welcome.html.haml index 5694435..bc1972d 100644 --- a/app/views/menus/welcome.html.haml +++ b/app/views/menus/welcome.html.haml @@ -1,4 +1,5 @@ = render 'layouts/flash' +#signUp .hero-unit .text-center %h1{:style => "color: #336699;"} On-Demand Automation Testing Framework diff --git a/app/views/queue_cart/_rep_list.html.haml b/app/views/queue_cart/_rep_list.html.haml index e8566ef..f452929 100644 --- a/app/views/queue_cart/_rep_list.html.haml +++ b/app/views/queue_cart/_rep_list.html.haml @@ -1,5 +1,6 @@ %ul.nav.nav-list.nav-stacked#rep-list-options %li.divider - - Execution.where(user_id: current_user.id).group("name").order(created_at: :desc).to_a.each do |r| + - @rep = Report.select('max(reports.id), reports.name, max(created_at) as last_run, max(job_id) as job_id').where(user_id: current_user.id).group('name').order('last_run DESC').to_a + - @rep.each do |r| %li.dropdown - = link_to raw("#{r.name}"), queue_show_report_path(name: r.name), remote: true \ No newline at end of file + = link_to raw("#{r.name}"), queue_show_report_path(job_id: r.job_id), remote: true \ No newline at end of file diff --git a/app/views/queue_cart/delete_report.js.haml b/app/views/queue_cart/delete_report.js.haml new file mode 100644 index 0000000..f175761 --- /dev/null +++ b/app/views/queue_cart/delete_report.js.haml @@ -0,0 +1,2 @@ +$("#notice").replaceWith("#{escape_javascript render 'layouts/flash.html.haml'}"); +$("#report_#{@report_name}").remove(); \ No newline at end of file diff --git a/app/views/queue_cart/destroy.js.haml b/app/views/queue_cart/destroy.js.haml index 08b0c41..9fb2739 100644 --- a/app/views/queue_cart/destroy.js.haml +++ b/app/views/queue_cart/destroy.js.haml @@ -1,2 +1,2 @@ $("#notice").replaceWith("#{escape_javascript render 'layouts/flash.html.haml'}"); -$("#q_row_#{@queue.id}").remove(); \ No newline at end of file +$("#job_#{@job_id}").remove(); \ No newline at end of file diff --git a/app/views/queue_cart/destroy_all.js.haml b/app/views/queue_cart/destroy_all.js.haml new file mode 100644 index 0000000..7356e70 --- /dev/null +++ b/app/views/queue_cart/destroy_all.js.haml @@ -0,0 +1,3 @@ +$("#notice").replaceWith("#{escape_javascript render 'layouts/flash.html.haml'}"); +- @jobs.each do |job| + $("#job_#{job.id}").remove() \ No newline at end of file diff --git a/app/views/queue_cart/exec_sel.js.haml b/app/views/queue_cart/exec_sel.js.haml deleted file mode 100644 index 4e883af..0000000 --- a/app/views/queue_cart/exec_sel.js.haml +++ /dev/null @@ -1,4 +0,0 @@ -$('#status').replaceWith(""); - -- @exec_id.each do |ex| - $("#exec_#{ex}").replaceWith(""); \ No newline at end of file diff --git a/app/views/queue_cart/execute.js.haml b/app/views/queue_cart/execute.js.haml new file mode 100644 index 0000000..2e3c6ea --- /dev/null +++ b/app/views/queue_cart/execute.js.haml @@ -0,0 +1,4 @@ +$('#status').replaceWith(""); + +- @job_ids.each do |jid| + $("#exec_#{jid}").replaceWith(""); \ No newline at end of file diff --git a/app/views/queue_cart/index.html.haml b/app/views/queue_cart/index.html.haml index 61b2a7a..5360900 100644 --- a/app/views/queue_cart/index.html.haml +++ b/app/views/queue_cart/index.html.haml @@ -1,9 +1,9 @@ .row-fluid #menu-tab.span2 %ul.nav.nav-pills.nav-stacked.bs-docs-sidenav.affix - %li= link_to "Pending Jobs",queue_show_path, remote: true, id: 'i1' - %li= link_to "Processed Jobs", '#', remote: true - %li= link_to "All Reports", queue_view_report_path, remote:true + %li= link_to "Pending Jobs",queue_show_pending_path, remote: true, id: 'i1' + %li= link_to "Processed Jobs", queue_show_processed_path, remote: true + %li= link_to "All Reports", queue_reports_path, remote:true %li #rep-list-options .span10 diff --git a/app/views/queue_cart/reports.html.haml b/app/views/queue_cart/reports.html.haml new file mode 100644 index 0000000..7ef29bb --- /dev/null +++ b/app/views/queue_cart/reports.html.haml @@ -0,0 +1,15 @@ +#tab-content + = render 'layouts/flash' + .row-fluid + %span.label.label-info Available Reports: + %br + %table.table.table-bordered.table-hover + %tr.info + %td Report Name + %td Last Run + %td Options + - @reports.each do |r| + %tr{id: "report_#{r.name}"} + %td= link_to r.name, queue_show_report_path(job_id: r.job_id), remote: true + %td= r.last_run.strftime('%H:%M:%S on %d-%m-%Y') + %td= link_to "",queue_delete_report_path(name: r.name), method: :delete, remote:true, data: {confirm: "Are you sure you want to delete #{r.name}?"},class:'btn btn-small icon-trash' \ No newline at end of file diff --git a/app/views/queue_cart/view_report.js.haml b/app/views/queue_cart/reports.js.haml similarity index 70% rename from app/views/queue_cart/view_report.js.haml rename to app/views/queue_cart/reports.js.haml index bcb5255..e7dc3c3 100644 --- a/app/views/queue_cart/view_report.js.haml +++ b/app/views/queue_cart/reports.js.haml @@ -1,2 +1,2 @@ $("#rep-list-options").hide(); -$("#tab-content").replaceWith("#{escape_javascript render(file: 'queue_cart/view_report.html.haml')}"); +$("#tab-content").replaceWith("#{escape_javascript render(file: 'queue_cart/reports.html.haml')}"); diff --git a/app/views/queue_cart/show.html.haml b/app/views/queue_cart/show.html.haml deleted file mode 100644 index 42b49a0..0000000 --- a/app/views/queue_cart/show.html.haml +++ /dev/null @@ -1,76 +0,0 @@ -#tab-content - .row-fluid - %span.label.label-info Job List - %br - = form_tag(queue_exec_sel_path, remote: true, id: 'job_queue') do - .row-fluid - #menu-bar - = submit_tag "Execute Selected", class: 'btn btn-primary', id: 'exec_sel' - = submit_tag "Execute All", class: 'btn btn-primary' - %span.pull-right - %label.checkbox.inline - #select_all Select All - %label.checkbox.inline - #select_none Select None - %br - = render(:partial => "layouts/flash") - #test-contents - %table.table.table-bordered.table-hover - %tbody - %tr.info - %td Select - %td Test Suite Name - %td Test Name - %td Test Step Name - %td Options - - if @queues.size == 0 - %tr - %td{colspan: 5} No Jobs in queue! - - else - - @queues.each do |q| - %tr{id:"q_row_#{q.id}"} - - if ExecProgress.where(queue_id: q.id).first - %td - %span{id: "exec_#{q.id}"}= image_tag 'step.gif', :'data-toggle' => 'tooltip', title: "Job Run in Progress" - %td= TestSuite.find(q.test_suite_id).name - - if q.test_id - %td= Test.find(q.test_id).name - - else - %td - - if q.test_step_id - %td= TestStep.find(q.test_step_id).step_name - - else - %td - %td= link_to "", '#', confirm: "Sorry, the Job is in progress!", class: 'btn btn-small icon-trash' - - - else - %td - %span{id: "exec_#{q.id}"}= check_box_tag('exec_id[]', q.id) - %td= TestSuite.find(q.test_suite_id).name - - if q.test_id - %td= Test.find(q.test_id).name - - else - %td - - if q.test_step_id - %td= TestStep.find(q.test_step_id).step_name - - else - %td - %td= link_to "", queue_path(id: q.id), method: :delete, confirm: "Are you sure you want to delete the pending job?", remote: true, class: 'btn btn-small icon-trash' - :coffee - - $("#select_all").click -> - $(@).css('color','#5C0000') - $(@).css('text-decoration','underline') - $('#select_none').css('color','#0088CC') - $('#select_none').css('text-decoration','none') - $('input[type="checkbox"]').each -> - if($(@).is(':disabled') == false) - $(@).prop('checked', true) - false - $("#select_none").click -> - $(@).css('color','#5C0000') - $(@).css('text-decoration','underline') - $('#select_all').css('color','#0088CC') - $('#select_all').css('text-decoration','none') - $('input[type="checkbox"]').prop('checked', false) - false \ No newline at end of file diff --git a/app/views/queue_cart/show_pending.html.haml b/app/views/queue_cart/show_pending.html.haml new file mode 100644 index 0000000..799f5b1 --- /dev/null +++ b/app/views/queue_cart/show_pending.html.haml @@ -0,0 +1,66 @@ +#tab-content + .row-fluid + %span.label.label-info Job List + %br + = form_tag(queue_execute_path, remote: true, id: 'job_queue') do + .row-fluid + #menu-bar + = submit_tag "Execute Selected", class: 'btn btn-primary' + = submit_tag "Execute All", class: 'btn btn-primary' + %span.pull-right + %label.checkbox.inline + = link_to "Delete All", queue_delete_all_path, method: :delete, data: {confirm: "Are you sure you want to delete the pending job?"}, remote: true + %label.checkbox.inline + %a#select_all{href: '#'} Select All + %label.checkbox.inline + %a#select_none{href: '#'} Select None + %br + = render(:partial => "layouts/flash") + #test-contents + %table.table.table-bordered.table-hover + %tbody + %tr.info + %td Select + %td Test Suite Name + %td Test Name + %td Test Step Name + %td Options + - if @jobs.nil? or @jobs.size==0 + %tr + %td{colspan: 5} No Jobs in queue! + - else + - @jobs.each do |job| + %tr{id:"job_#{job.id}"} + - if job.status=="Started" + %td= image_tag("step.gif") + - else + %td + %span{id: "exec_#{job.id}"}= check_box_tag('job_id[]', job.id) + %td= TestSuite.find(job.test_suite_id).name + %td= Test.find(job.test_id).name unless job.test_id.nil? + %td= TestStep.find(job.test_step_id).step_name unless job.test_step_id.nil? + - if job.status=="Pending" + %td= link_to "", queue_path(id: job.id), method: :delete, data: {confirm: "Are you sure you want to delete the pending job?"}, remote: true, class: 'btn btn-small icon-trash' + - else + %td= link_to "",'#', data: {toggle: 'tooltip', confirm: 'You cannot delete a job in progress!'}, title: 'Job run in progress!', class: 'btn btn-small icon-trash' + :coffee + $("#delete_all").click -> + if(confirm("Are you sure you want to delete all the pending jobs?")) + alert($("table tr").length) + false + $("#select_all").click -> + $(@).css('color','#5C0000') + $(@).css('text-decoration','underline') + $('#select_none').css('color','#0088CC') + $('#select_none').css('text-decoration','none') + $('input[type="checkbox"]').each -> + if($(@).is(':disabled') == false) + $(@).prop('checked', true) + false + $("#select_none").click -> + $(@).css('color','#5C0000') + $(@).css('text-decoration','underline') + $('#select_all').css('color','#0088CC') + $('#select_all').css('text-decoration','none') + $('input[type="checkbox"]').prop('checked', false) + false \ No newline at end of file diff --git a/app/views/queue_cart/show.js.haml b/app/views/queue_cart/show_pending.js.haml similarity index 70% rename from app/views/queue_cart/show.js.haml rename to app/views/queue_cart/show_pending.js.haml index 1b7c0ad..a86df42 100644 --- a/app/views/queue_cart/show.js.haml +++ b/app/views/queue_cart/show_pending.js.haml @@ -1,2 +1,2 @@ $("#rep-list-options").hide(); -$('#tab-content').replaceWith("#{escape_javascript render file: 'queue_cart/show.html.haml'}"); \ No newline at end of file +$('#tab-content').replaceWith("#{escape_javascript render file: 'queue_cart/show_pending.html.haml'}"); \ No newline at end of file diff --git a/app/views/queue_cart/show_processed.html.haml b/app/views/queue_cart/show_processed.html.haml new file mode 100644 index 0000000..498bfd8 --- /dev/null +++ b/app/views/queue_cart/show_processed.html.haml @@ -0,0 +1,29 @@ +#tab-content + .row-fluid + %span.label.label-info Processed Job(s) + %br + = render(:partial => "layouts/flash") + #test-contents + %table.table.table-bordered.table-hover + %tbody + %tr.info + %td Test Suite Name + %td Test Name + %td Test Step Name + %td Start Time + %td End Time + %td Elapsed Time + %td Options + - if @jobs.nil? or @jobs.size==0 + %tr + %td{colspan: 7} No Processed Jobs! + - else + - @jobs.each do |job| + %tr{id:"job_#{job.id}"} + %td= TestSuite.find(job.test_suite_id).name + %td= Test.find(job.test_id).name unless job.test_id.nil? + %td= TestStep.find(job.test_step_id).step_name unless job.test_step_id.nil? + %td= job.start_time.strftime('%d-%m-%Y %H:%M:%S') + %td= job.finish_time.strftime('%d-%m-%Y %H:%M:%S') + %td= "#{(job.finish_time-job.start_time).round} seconds" + %td= link_to "", queue_path(id: job.id), method: :delete, data: {confirm: "Are you sure you want to delete the pending job?"}, remote: true, class: 'btn btn-small icon-trash' \ No newline at end of file diff --git a/app/views/queue_cart/show_processed.js.haml b/app/views/queue_cart/show_processed.js.haml new file mode 100644 index 0000000..32eed16 --- /dev/null +++ b/app/views/queue_cart/show_processed.js.haml @@ -0,0 +1,2 @@ +$("#rep-list-options").hide(); +$('#tab-content').replaceWith("#{escape_javascript render file: 'queue_cart/show_processed.html.haml'}"); \ No newline at end of file diff --git a/app/views/queue_cart/show_report.html.haml b/app/views/queue_cart/show_report.html.haml index 9c155f0..bae5a5a 100644 --- a/app/views/queue_cart/show_report.html.haml +++ b/app/views/queue_cart/show_report.html.haml @@ -1,47 +1,48 @@ #tab-content + #imageFrame .row-fluid - %span.label.label-info Web Elements Used: + %span.label.label-info Report Name: + %span= @reports.first.name + %br + .row-fluid + %span.label.label-info Test Suite Name: + %span= @test_suite.name %br - %table.table.table-bordered.table-hover - %tr.info - %td Repository Name - %td Element Name - %td Element Type - %td Identifier Name - %td Identifier Value - - @steps.each do |st| - - if !st.element_id.nil? - %tr - %td= ObjectRepository.find(st.object_repository_id).name - %td= WebElement.find(st.element_id).element_name - %td= WebElement.find(st.element_id).element_type - %td= WebElement.find(st.element_id).identifier_name - %td= WebElement.find(st.element_id).identifier_value .row-fluid - %span.label.label-info Test Steps: + %span.label.label-info Test Name: + %span= @test.name %br %table.table.table-bordered.table-hover %tr.info - %td Step Name - %td Step Function - %td Step Value + %td S. No. + %td Description %td Status - %td Last Run - - @steps.each do |st| - - if st.status=="Pass" + %td Executed on + - @counter = 1 + - @reports.each do |report_step| + - if report_step.status=='Pass' %tr.success - %td= st.step_name - - if st.function.nil? - %td Assert - %td= st.expected - - else - %td= st.function - %td= st.value - %td= st.status - %td= st.last_run.strftime('%d-%m-%Y at %H:%M:%S') + %td= @counter + %td= report_step.description + %td= report_step.status + %td= report_step.created_at.strftime('%d-%m-%Y at %H:%M:%S') + - elsif report_step.status=='Fail' + %tr.warning + %td= @counter + %td= link_to raw(" #{report_step.description}"), queue_view_error_path(job_id: report_step.job_id, desc: report_step.description), remote: true, data: {toggle: 'tooltip'}, title: 'Click to see error screenshot' + %td= report_step.status + %td= report_step.created_at.strftime('%d-%m-%Y at %H:%M:%S') + - else + %td= @counter + %td= report_step.description + %td= report_step.status + %td= report_step.created_at.strftime('%d-%m-%Y at %H:%M:%S') + - @counter += 1 .row-fluid - Final Status: - - if @final_status=="Pass" + %span.label.label-info Final Status: + - if @final_status == 'Fail' + %span.label.label-fail Fail + - elsif @final_status == 'Pass' %span.label.label-success Pass - else - %span.label.label-important Fail \ No newline at end of file + %span.label= @final_status \ No newline at end of file diff --git a/app/views/queue_cart/view_error.html.haml b/app/views/queue_cart/view_error.html.haml new file mode 100644 index 0000000..273fca0 --- /dev/null +++ b/app/views/queue_cart/view_error.html.haml @@ -0,0 +1,11 @@ +#imageFrame + #imageModal.modal.hide.fade + .modal-header + = "Error for '#{@description}'" + %button.close{:'data-dismiss'=>"modal"} × + - if File.exists? "#{Rails.public_path}/errors/#{@user_name}/#{@file_name}" + %img{src: "errors/#{@user_name}/#{@file_name}"} + - else + %img{src: "404.jpg"} + :javascript + $('#imageModal').modal('toggle') \ No newline at end of file diff --git a/app/views/queue_cart/view_error.js.haml b/app/views/queue_cart/view_error.js.haml new file mode 100644 index 0000000..e7bfd2a --- /dev/null +++ b/app/views/queue_cart/view_error.js.haml @@ -0,0 +1 @@ +$("#imageFrame").replaceWith("#{escape_javascript render file: 'queue_cart/view_error.html.haml'}"); \ No newline at end of file diff --git a/app/views/queue_cart/view_report.html.haml b/app/views/queue_cart/view_report.html.haml deleted file mode 100644 index 8fe9b18..0000000 --- a/app/views/queue_cart/view_report.html.haml +++ /dev/null @@ -1,16 +0,0 @@ -#tab-content - .row-fluid - %span.label.label-info Available Reports: - %br - %table.table.table-bordered.table-hover - %tr.info - %td Report Name - %td Test Suite Name - %td Test Name - %td Last Run - - @reports.each do |r| - %tr - %td= link_to r.name, queue_show_report_path(name: r.name), remote: true - %td= TestSuite.find(r.test_suite_id).name - %td= Test.find(r.test_id).name - %td= r.last_run.strftime('%d-%m-%Y at %H:%M:%S') \ No newline at end of file diff --git a/app/views/sessions/new.html.haml b/app/views/sessions/new.html.haml index 99982e5..8b786a3 100644 --- a/app/views/sessions/new.html.haml +++ b/app/views/sessions/new.html.haml @@ -1,5 +1,5 @@ %ul.nav.pull-right - %li#signup= link_to "Sign Up", signup_path + %li#signup= link_to "Sign Up", signup_path, remote: true %li = form_for(:session, url: sessions_path, html: {id: 'form_signin'}) do |f| = f.text_field :email, id:'email', placeholder: "Email" diff --git a/app/views/test_steps/_form.html.haml b/app/views/test_steps/_form.html.haml index f6c231e..260301a 100644 --- a/app/views/test_steps/_form.html.haml +++ b/app/views/test_steps/_form.html.haml @@ -53,6 +53,9 @@ = f.label :value .span3 = f.text_field :value + %span.help-inline + %a{"data-toggle" => "tooltip", :href => "#", :title => "This is required for Input boxes or Asserts!"} + %i.icon-question-sign = f.submit class:'btn btn-primary' :javascript $(document).ready(function() { @@ -98,4 +101,13 @@ $('#test_step_value').prop('disabled',false); } }); + $('#function_select').change(function() { + if ($('#function_select').val() == 'Assert') { + $('#test_step_expected').attr('value',''); + $('#test_step_expected').prop('disabled',true); + } + else { + $('#test_step_expected').prop('disabled',false); + } + }); }); diff --git a/app/views/test_suites/show.html.haml b/app/views/test_suites/show.html.haml index d10a613..79616ce 100644 --- a/app/views/test_suites/show.html.haml +++ b/app/views/test_suites/show.html.haml @@ -29,7 +29,8 @@ %td= "#{t.last_run.strftime("%d-%m-%Y at %H:%M:%S")}" - else %td No Run - %td= link_to "", edit_test_suite_test_path(@test_suite.id, t.id),remote: true, class: 'btn btn-small icon-pencil' - %td= link_to "", test_suite_test_path(@test_suite.id, t.id), method: :delete, confirm: "Are you sure you want to delete test \'#{t.name}\'?", remote: true,class: 'btn btn-small icon-trash' - %td= link_to "", exec_test_path(test_id: t.id), remote: true, id: "exec_#{t.id}" , class: 'btn btn-small icon-wrench' - %td= link_to "", add_tc_to_queue_path(test_id: t.id), remote: true, id: "queue_tc_#{t.id}", class: 'btn btn-small icon-shopping-cart' \ No newline at end of file + %td= link_to "", edit_test_suite_test_path(@test_suite.id, t.id),remote: true, class: 'btn btn-small icon-pencil', data: {toggle: 'tooltip'}, title: 'Edit test case' + %td= link_to "", test_suite_test_path(@test_suite.id, t.id), method: :delete, data: {toggle: 'tooltip', confirm: "Are you sure you want to delete test \'#{t.name}\'?" }, remote: true,class: 'btn btn-small icon-trash', title: 'Delete test case' + // %td= link_to "", exec_test_path(test_id: t.id), remote: true, id: "exec_#{t.id}" , class: 'btn btn-small icon-wrench' + %td= link_to "", '#', remote: true, class: 'btn btn-small icon-share', data: {toggle: 'tooltip'}, title: 'Copy test case' + %td= link_to "", add_tc_to_queue_path(test_id: t.id), remote: true, id: "queue_tc_#{t.id}", class: 'btn btn-small icon-shopping-cart', data: {toggle: 'tooltip'}, title: 'Add test case to job queue' \ No newline at end of file diff --git a/app/views/tests/add_ts.js.haml b/app/views/tests/add_ts.js.haml index 8ee7769..6fa0403 100644 --- a/app/views/tests/add_ts.js.haml +++ b/app/views/tests/add_ts.js.haml @@ -1 +1 @@ -$("#notice").replaceWith("#{escape_javascript render 'layouts/flash.html.haml'}"); +$("#notice").replaceWith("#{escape_javascript render 'layouts/flash.html.haml'}"); \ No newline at end of file diff --git a/app/views/tests/show.html.haml b/app/views/tests/show.html.haml index 128e465..497bb85 100644 --- a/app/views/tests/show.html.haml +++ b/app/views/tests/show.html.haml @@ -36,14 +36,11 @@ %td= "#{t.function}" %td= "#{t.value}" %td= "#{t.status}" - - if t.last_run + - if !t.last_run.nil? %td= "#{t.last_run.strftime("%d-%m-%Y at %H:%M:%S")}" - else %td No Run %td= link_to "", edit_test_test_step_path(@test.id,t.id),remote: true, class: 'btn btn-small icon-pencil' %td= link_to "", test_test_step_path(@test.id,t.id), method: :delete, data: {confirm: "Are you sure you want to delete test step \'#{t.step_name}\'?"}, remote: true,class: 'btn btn-small icon-trash' - - if !ExecProgress.where(user_id: current_user.id, test_step_id: t.id).first.nil? - %td= image_tag 'step.gif', id: "exec_st_#{t.id}", :'data-toggle' => 'tooltip', title: "Executing '#{t.step_name}'" - - else - %td= link_to "", exec_test_step_path(test_step_id: t.id), remote: true, class: 'btn btn-small icon-wrench', id: "exec_st_#{t.id}" + %td= link_to "", exec_test_step_path(test_step_id: t.id), remote: true, class: 'btn btn-small icon-wrench', id: "exec_st_#{t.id}" %td= link_to "", add_ts_to_queue_path(test_step_id: t.id), remote: true, class: 'btn btn-small icon-shopping-cart', id: "queue_st_#{t.id}" diff --git a/app/views/users/_form.html.haml b/app/views/users/_form.html.haml index 806467f..2f5a7a8 100644 --- a/app/views/users/_form.html.haml +++ b/app/views/users/_form.html.haml @@ -1,19 +1,22 @@ -= form_for @user do |f| - - if @user.errors.any? - .offset4.text-center - #error_explanation.alert.alert-error - %h4= "#{pluralize(@user.errors.count, "error")} prohibited this user from being saved:" - %ul - - @user.errors.full_messages.each do |msg| - %li= msg - .row-fluid - .span1.offset5= f.label :email - .span3= f.text_field :email - .row-fluid - .span1.offset5= f.label :password - .span3= f.password_field :password - .row-fluid - .span1.offset5= f.label :password_confirmation, "Confirmation" - .span3= f.password_field :password_confirmation - .row-fluid - .span3.offset6= f.submit 'Save', class: 'btn btn-primary' +.modal-header + %button.close{:'data-dismiss'=>"modal"} × + %h3 Sign Up += form_for @user, remote: true do |f| + .modal-body.text-right + - if @user.errors.any? + #error_explanation.alert.alert-error + %h4= "#{pluralize(@user.errors.count, "error")} prohibited this user from being saved:" + %ul + - @user.errors.full_messages.each do |msg| + %li= msg + .row-fluid + .span3= f.label :email + .span3.offset2= f.text_field :email + .row-fluid + .span3= f.label :password + .span3.offset2= f.password_field :password + .row-fluid + .span3= f.label :password_confirmation, "Confirmation" + .span3.offset2= f.password_field :password_confirmation + .modal-footer + = f.submit 'Create User', class: 'btn btn-primary' \ No newline at end of file diff --git a/app/views/users/create.js.haml b/app/views/users/create.js.haml new file mode 100644 index 0000000..117f1d2 --- /dev/null +++ b/app/views/users/create.js.haml @@ -0,0 +1,9 @@ +- if @user.errors.any? + $('#signUpModal').modal('toggle'); + $("#signUp").replaceWith("#{escape_javascript render file: 'users/new.html.haml'}"); +- else + $('#signUpModal').modal('toggle'); + $('#signUp').remove(); + $('.navbar').replaceWith("#{escape_javascript render 'layouts/navigation.html.haml'}"); + $("#main-area").replaceWith("#{escape_javascript render file: 'menus/home.html.haml'}"); + document.location.hash = "#home" \ No newline at end of file diff --git a/app/views/users/new.html.haml b/app/views/users/new.html.haml index 23e6a55..5b8ce24 100644 --- a/app/views/users/new.html.haml +++ b/app/views/users/new.html.haml @@ -1,4 +1,5 @@ -.well.well-large - %h4.offset6 Sign Up - %br - = render 'form' \ No newline at end of file +#signUp + #signUpModal.modal.hide.fade + = render 'form' + :javascript + $('#signUpModal').modal('toggle') \ No newline at end of file diff --git a/app/views/users/new.js.haml b/app/views/users/new.js.haml new file mode 100644 index 0000000..3702816 --- /dev/null +++ b/app/views/users/new.js.haml @@ -0,0 +1 @@ +$("#signUp").replaceWith("#{escape_javascript render file: 'users/new.html.haml'}"); \ No newline at end of file diff --git a/app/views/web_elements/_form.html.haml b/app/views/web_elements/_form.html.haml index 78a0ab3..63a19b9 100644 --- a/app/views/web_elements/_form.html.haml +++ b/app/views/web_elements/_form.html.haml @@ -24,7 +24,7 @@ .span2 = f.label :element_type .span6 - = f.select :element_type, [['Text Box'],['Select Box'], ['Option Box'],['Link'],['Button']] + = f.select :element_type, [['Text'],['Text Box'],['Select Box'], ['Option Box'],['Link'],['Button']] .row-fluid %p .span2 diff --git a/app/views/web_elements/new.html.haml b/app/views/web_elements/new.html.haml index 82563cc..de6c17e 100644 --- a/app/views/web_elements/new.html.haml +++ b/app/views/web_elements/new.html.haml @@ -1,4 +1,4 @@ #or-contents .row-fluid %h4 Create Web Element: - = render 'form' + = render 'form' \ No newline at end of file diff --git a/app/workers/methods.rb b/app/workers/methods.rb index ecf6fe2..d508918 100644 --- a/app/workers/methods.rb +++ b/app/workers/methods.rb @@ -2,11 +2,11 @@ class Methods include Selenium # Initialising driver - def initialize_driver(web_url) - @driver = Selenium::WebDriver.for :firefox #:remote, url: "http://localhost:9134" + def initialize_driver(web_url, port) + @driver = Selenium::WebDriver.for :remote, :url => "http://localhost:4444/wd/hub/" #:remote, url: "http://localhost:#{port}" @wait = Selenium::WebDriver::Wait.new(timeout:10) @driver.manage.window.maximize - @driver.get "#{web_url}" + @driver.get web_url end ######################################## @@ -38,20 +38,26 @@ def execute_test_step(web_element,function,value) log << ("\n'" + web_element.element_name.to_s + "' Presence: True") case function when 'Click' - e.send_keys :return + e.click log << ("\nAction: Click") when 'Select Option' - e.send_keys :return + e.click log << ("\nAction: Selected option") when 'Enter Value' e.send_keys(value) log << ("\nAction: Enter Value - #{value}") + when 'Assert' + log << ("\nAction: Asserting - #{value}") + if !(e.text.eql? value) then + raise "\nAsserting - #{value} failed\nFound: '#{e.text}', Expecting: '#{value}'" + end end else raise "\nCould not find element #{e.element_name}" end return log, "Pass" rescue Exception => e + log << e.message return log, "Fail" end @@ -78,13 +84,17 @@ def assert(expected) end end + def tk_screenshot(path) + @driver.save_screenshot("#{path}") + end + def close @driver.quit end private def find hash - @wait.until { @driver.find_element hash } - @driver.find_element hash + @wait.until { @driver.find_element hash } + @driver.find_element hash end end \ No newline at end of file diff --git a/app/workers/test_step_worker.rb b/app/workers/test_step_worker.rb index 26dfd10..96c7052 100644 --- a/app/workers/test_step_worker.rb +++ b/app/workers/test_step_worker.rb @@ -80,10 +80,10 @@ def perform(test_step_id, user_id) EM.run { client = Faye::Client.new('http://192.168.10.54:9292/faye') publication = client.publish("/users/#{user.id}", " - $('#notification').replaceWith(''); + $('#notification').replaceWith(''); $('#notification').css(\"background-color\", \"#8A0707\"); $('#status').replaceWith(''); - $(\'#exec_st_#{test_step.id}\').replaceWith(\'\'); + $('#exec_st_#{test_step.id}').replaceWith(''); ") publication.callback do diff --git a/app/workers/test_worker.rb b/app/workers/test_worker.rb index d26207f..68fa145 100644 --- a/app/workers/test_worker.rb +++ b/app/workers/test_worker.rb @@ -1,6 +1,8 @@ class TestWorker include Sidekiq::Worker include Selenium + require 'eventmachine' + require 'faye' # Importing all methods require_relative 'methods' @@ -15,95 +17,71 @@ class TestWorker ActiveRecord::Base.establish_connection end end + ######################################## # This method performs the test execution asynchronously - def perform(test_id, user_id) + def perform(job_id) - test = Test.find(test_id) + job = Job.find(job_id) + + test = Test.find(job.test_id) - user = User.find(user_id) + user = User.find(job.user_id) param_url = SeleniumConfig.find_by_user_id(user.id).url.to_sym - run_status = execute_test(user,param_url,test) + job.update_attributes(start_time: DateTime.now) + + run_status = execute_test(job.id,user,param_url,test) logger.info("\nFinal Status: " + run_status.to_s) - test.update_attributes(status: run_status, last_run: DateTime.now) + job.update_attributes(status: 'Finished',finish_time: DateTime.now) - execution = ExecProgress.where(user_id: user.id, test_id: test.id).first + #test.update_attributes(status: run_status, last_run: DateTime.now) - if execution.queue_id - - QueueCart.delete(execution.queue_id) - - qid = execution.queue_id - - ExecProgress.delete(execution.id) - - EM.run { - client = Faye::Client.new('http://192.168.10.54:9292/faye') - publication = client.publish("/users/#{user.id}", " - $('#notification').replaceWith(''); - $('#notification').css(\"background-color\", \"#8A0707\"); - $('#status').replaceWith(''); - $('#q_row_#{qid}').remove(); - ") - - publication.callback do - logger.info("Message sent to channel '/users/#{user.id}'") - end - - publication.errback do |error| - logger.info('There was a problem: ' + error.message) - end - } - else - - ExecProgress.delete(execution.id) - - EM.run { - client = Faye::Client.new('http://192.168.10.54:9292/faye') - publication = client.publish("/users/#{user.id}", " - $('#notification').replaceWith(''); - $('#notification').css(\"background-color\", \"#8A0707\"); - $('#status').replaceWith(''); - $('#exec_#{test.id}').replaceWith(\'\'); - ") - - publication.callback do - logger.info("Message sent to channel '/users/#{user.id}'") - end + EM.run { + client = Faye::Client.new('http://192.168.10.54:9292/faye') + publication = client.publish("/users/#{user.id}", " + $('#notification').replaceWith(''); + $('#notification').css(\"background-color\", \"#8A0707\"); + $('#status').replaceWith(''); + $('#job_#{job.id}').remove(); + ") + + publication.callback do + logger.info("Message sent to channel '/users/#{user.id}'") + end - publication.errback do |error| - logger.info('There was a problem: ' + error.message) - end - } + publication.errback do |error| + logger.info('There was a problem: ' + error.message) + end + } - end end ######################################## # This method performs the selenium test execution - def execute_test(user,url,test) + def execute_test(job_id,user,url,test) method = Methods.new logger.info("Inside execute test") - method.initialize_driver(url) + port = 4444 + + method.initialize_driver(url, port) test_steps = TestStep.where(test_id: test.id) log="" run_status="" - - execution_name = DateTime.now.strftime('%d%m%Y_%H%M%S') + report_name = DateTime.now.strftime('%d%m%y_%H%M%S') + Report.create(name: report_name, job_id: job_id, user_id: user.id, description: "Execution of #{test.name} started") test_steps.each do |ts| - execution = Execution.new(:name => execution_name, :user_id => user.id, :test_suite_id => test.test_suite_id, :test_id => test.id, :test_step_id => ts.id) if ts.element_id web_element = WebElement.find(ts.element_id) log, run_status = method.execute_test_step(web_element,ts.function,ts.value) @@ -112,14 +90,16 @@ def execute_test(user,url,test) log, run_status = method.assert(ts.expected) logger.info("\nTest Step: '" + ts.step_name.to_s + "' : " + run_status.to_s) end - ts.update_attributes(status: run_status, last_run: DateTime.now) - execution.status = run_status - execution.last_run = DateTime.now - execution.save + Report.create(name: report_name, job_id: job_id, user_id: user.id, description: "#{ts.step_name.to_s}", status: run_status.to_s) + if run_status=="Fail" then + method.tk_screenshot("./public/errors/#{user.email}/#{job_id}_error.png") + logger.info("Fail Message: #{log}") + end + #ts.update_attributes(status: run_status, last_run: DateTime.now) end method.close - + Report.create(name: report_name, job_id: job_id, user_id: user.id, description: "Execution of #{test.name} completed") return run_status end ######################################## diff --git a/config/database.yml b/config/database.yml index 3e817ac..c3ae7e1 100644 --- a/config/database.yml +++ b/config/database.yml @@ -4,22 +4,27 @@ # Ensure the SQLite 3 gem is defined in your Gemfile # gem 'sqlite3' development: - adapter: sqlite3 - database: db/development.sqlite3 + #adapter: sqlite3 + #database: db/development.sqlite3 + adapter: postgresql + encoding: utf8 + database: project_development + username: dev + password: dev pool: 25 - timeout: 5000 + timeout: 15000 # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. -test: - adapter: sqlite3 - database: db/test.sqlite3 - pool: 5 - timeout: 5000 +# test: +# adapter: sqlite3 +# database: db/test.sqlite3 +# pool: 5 +# timeout: 5000 -production: - adapter: sqlite3 - database: db/production.sqlite3 - pool: 5 - timeout: 5000 +# production: +# adapter: sqlite3 +# database: db/production.sqlite3 +# pool: 5 +# timeout: 5000 diff --git a/config/routes.rb b/config/routes.rb index feeb772..1f1443a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -10,7 +10,7 @@ resources :web_elements end resources :test_suites do - resources :tests + resources :tests end resources :tests do resources :test_steps @@ -39,6 +39,7 @@ # Test Paths match '/exec_test_step' , to: 'tests#exec_test_step', via: 'get' match '/add_ts_to_queue', to: 'tests#add_ts', via: 'get' + #match '/test_suites/:test_suite_id/tests/:id/copy', to: 'tests#copy_test', via: 'get' # Test Step Paths match '/update_pages', to: 'test_steps#update_pages', via: 'get' @@ -47,12 +48,15 @@ # Queue Paths match '/queue', to: 'queue_cart#index', via: 'get' - match '/queue/show', to: 'queue_cart#show', via: 'get' - match '/queue/view_report', to: 'queue_cart#view_report', via: 'get' + match '/queue/show_pending', to: 'queue_cart#show_pending', via: 'get' + match '/queue/show_processed', to: 'queue_cart#show_processed', via: 'get' + match '/queue/reports', to: 'queue_cart#reports', via: 'get' match '/queue/show_report', to: 'queue_cart#show_report', via: 'get' - #match '/queue/exec_all', to: 'queue_cart#exec_all', via: 'get' - match '/queue/exec_sel', to: 'queue_cart#exec_sel', via: 'post' + match '/queue/view_error', to: 'queue_cart#view_error', via: 'get' + match '/queue/delete_report', to: 'queue_cart#delete_report', via: 'delete' + match '/queue/execute', to: 'queue_cart#execute', via: 'post' match '/queue', to: 'queue_cart#destroy', via: 'delete' + match '/queue/delete_all', to: 'queue_cart#destroy_all', via: 'delete' # Sidekiq Dashboard Path mount Sidekiq::Web, at: '/sidekiq' diff --git a/db/migrate/20140107083652_create_login_test_data.rb b/db/migrate/20140107083652_create_login_test_data.rb deleted file mode 100644 index a1ae19b..0000000 --- a/db/migrate/20140107083652_create_login_test_data.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateLoginTestData < ActiveRecord::Migration - def change - create_table :login_test_data do |t| - t.string :email - t.string :password - t.boolean :check - - t.timestamps - end - end -end diff --git a/db/migrate/20140122122415_add_column_last_run_to_tests.rb b/db/migrate/20140122122415_add_column_last_run_to_tests.rb index 2af1d0f..77d8700 100644 --- a/db/migrate/20140122122415_add_column_last_run_to_tests.rb +++ b/db/migrate/20140122122415_add_column_last_run_to_tests.rb @@ -1,5 +1,5 @@ class AddColumnLastRunToTests < ActiveRecord::Migration def change - add_column :tests, :last_run, :DateTime + add_column :tests, :last_run, :timestamp end end diff --git a/db/migrate/20140122140459_add_column_status_and_last_run_to_test_steps.rb b/db/migrate/20140122140459_add_column_status_and_last_run_to_test_steps.rb index 123ba19..13cb375 100644 --- a/db/migrate/20140122140459_add_column_status_and_last_run_to_test_steps.rb +++ b/db/migrate/20140122140459_add_column_status_and_last_run_to_test_steps.rb @@ -1,6 +1,6 @@ class AddColumnStatusAndLastRunToTestSteps < ActiveRecord::Migration def change add_column :test_steps, :status, :string - add_column :test_steps, :last_run, :DateTime + add_column :test_steps, :last_run, :timestamp end end diff --git a/db/migrate/20140128083653_add_column_name_to_execution.rb b/db/migrate/20140128083653_add_column_name_to_execution.rb deleted file mode 100644 index 823a048..0000000 --- a/db/migrate/20140128083653_add_column_name_to_execution.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddColumnNameToExecution < ActiveRecord::Migration - def change - add_column :executions, :name, :string - end -end diff --git a/db/migrate/20140206140730_create_exec_progress.rb b/db/migrate/20140206140730_create_exec_progress.rb deleted file mode 100644 index f4111a8..0000000 --- a/db/migrate/20140206140730_create_exec_progress.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateExecProgress < ActiveRecord::Migration - def change - create_table :exec_progress do |t| - t.integer :user_id - t.integer :test_id - t.integer :test_step_id - - t.timestamps - end - end -end diff --git a/db/migrate/20140206141037_add_column_status_to_exec_progress.rb b/db/migrate/20140206141037_add_column_status_to_exec_progress.rb deleted file mode 100644 index 51444a4..0000000 --- a/db/migrate/20140206141037_add_column_status_to_exec_progress.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddColumnStatusToExecProgress < ActiveRecord::Migration - def change - add_column :exec_progress, :status, :string - end -end diff --git a/db/migrate/20140206141519_create_exec_progresses.rb b/db/migrate/20140206141519_create_exec_progresses.rb deleted file mode 100644 index eb355b4..0000000 --- a/db/migrate/20140206141519_create_exec_progresses.rb +++ /dev/null @@ -1,12 +0,0 @@ -class CreateExecProgresses < ActiveRecord::Migration - def change - create_table :exec_progresses do |t| - t.integer :user_id - t.integer :test_id - t.integer :test_step_id - t.string :status - - t.timestamps - end - end -end diff --git a/db/migrate/20140210124854_create_queue_carts.rb b/db/migrate/20140210124854_create_queue_carts.rb deleted file mode 100644 index 5245494..0000000 --- a/db/migrate/20140210124854_create_queue_carts.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateQueueCarts < ActiveRecord::Migration - def change - create_table :queue_carts do |t| - t.integer :test_suite_id - t.integer :test_id - t.integer :test_step_id - - t.timestamps - end - end -end diff --git a/db/migrate/20140211111232_add_column_queue_id_to_exec_progresses.rb b/db/migrate/20140211111232_add_column_queue_id_to_exec_progresses.rb deleted file mode 100644 index 3a40f83..0000000 --- a/db/migrate/20140211111232_add_column_queue_id_to_exec_progresses.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddColumnQueueIdToExecProgresses < ActiveRecord::Migration - def change - add_column :exec_progresses, :queue_id, :integer - end -end diff --git a/db/migrate/20140128082120_create_executions.rb b/db/migrate/20140213104554_create_jobs.rb similarity index 58% rename from db/migrate/20140128082120_create_executions.rb rename to db/migrate/20140213104554_create_jobs.rb index 84e0519..35e8839 100644 --- a/db/migrate/20140128082120_create_executions.rb +++ b/db/migrate/20140213104554_create_jobs.rb @@ -1,12 +1,13 @@ -class CreateExecutions < ActiveRecord::Migration +class CreateJobs < ActiveRecord::Migration def change - create_table :executions do |t| + create_table :jobs do |t| t.integer :user_id t.integer :test_suite_id t.integer :test_id t.integer :test_step_id t.string :status - t.datetime :last_run + t.datetime :start_time + t.string :finish_time t.timestamps end diff --git a/db/migrate/20140224085322_create_reports.rb b/db/migrate/20140224085322_create_reports.rb new file mode 100644 index 0000000..457a5cf --- /dev/null +++ b/db/migrate/20140224085322_create_reports.rb @@ -0,0 +1,12 @@ +class CreateReports < ActiveRecord::Migration + def change + create_table :reports do |t| + t.string :name + t.integer :job_id + t.integer :user_id + t.string :description + + t.timestamps + end + end +end diff --git a/db/migrate/20140224085638_add_column_status_to_report.rb b/db/migrate/20140224085638_add_column_status_to_report.rb new file mode 100644 index 0000000..33db60d --- /dev/null +++ b/db/migrate/20140224085638_add_column_status_to_report.rb @@ -0,0 +1,5 @@ +class AddColumnStatusToReport < ActiveRecord::Migration + def change + add_column :reports, :status, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index bd0db1f..1b03a83 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,36 +11,21 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140211111232) do +ActiveRecord::Schema.define(version: 20140224085638) do - create_table "exec_progresses", force: true do |t| - t.integer "user_id" - t.integer "test_id" - t.integer "test_step_id" - t.string "status" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "queue_id" - end + # These are extensions that must be enabled in order to support this database + enable_extension "plpgsql" - create_table "executions", force: true do |t| + create_table "jobs", force: true do |t| t.integer "user_id" t.integer "test_suite_id" t.integer "test_id" t.integer "test_step_id" t.string "status" - t.datetime "last_run" - t.datetime "created_at" - t.datetime "updated_at" - t.string "name" - end - - create_table "login_test_data", force: true do |t| - t.string "email" - t.string "password" - t.boolean "check" + t.datetime "start_time" t.datetime "created_at" t.datetime "updated_at" + t.datetime "finish_time" end create_table "object_repositories", force: true do |t| @@ -55,10 +40,21 @@ t.integer "test_suite_id" t.integer "test_id" t.integer "test_step_id" + t.integer "user_id" t.datetime "created_at" t.datetime "updated_at" end + create_table "reports", force: true do |t| + t.string "name" + t.integer "job_id" + t.integer "user_id" + t.string "description" + t.datetime "created_at" + t.datetime "updated_at" + t.string "status" + end + create_table "selenium_configs", force: true do |t| t.string "browser" t.string "url" @@ -110,7 +106,7 @@ t.string "password_digest" end - add_index "users", ["remember_token"], name: "index_users_on_remember_token" + add_index "users", ["remember_token"], name: "index_users_on_remember_token", using: :btree create_table "web_elements", force: true do |t| t.string "page_name" diff --git a/public/404.jpg b/public/404.jpg new file mode 100644 index 0000000..4ab01d3 Binary files /dev/null and b/public/404.jpg differ diff --git a/public/errors/user_1@abc.com/12_error.png b/public/errors/user_1@abc.com/12_error.png new file mode 100644 index 0000000..f7ac407 Binary files /dev/null and b/public/errors/user_1@abc.com/12_error.png differ diff --git a/public/errors/user_1@abc.com/13_error.png b/public/errors/user_1@abc.com/13_error.png new file mode 100644 index 0000000..d413ffe Binary files /dev/null and b/public/errors/user_1@abc.com/13_error.png differ diff --git a/public/errors/user_1@abc.com/14_error.png b/public/errors/user_1@abc.com/14_error.png new file mode 100644 index 0000000..d413ffe Binary files /dev/null and b/public/errors/user_1@abc.com/14_error.png differ diff --git a/public/errors/user_1@abc.com/17_error.png b/public/errors/user_1@abc.com/17_error.png new file mode 100644 index 0000000..d413ffe Binary files /dev/null and b/public/errors/user_1@abc.com/17_error.png differ diff --git a/public/errors/user_1@abc.com/18_error.png b/public/errors/user_1@abc.com/18_error.png new file mode 100644 index 0000000..d413ffe Binary files /dev/null and b/public/errors/user_1@abc.com/18_error.png differ diff --git a/public/errors/user_1@abc.com/7_error.png b/public/errors/user_1@abc.com/7_error.png new file mode 100644 index 0000000..337a290 Binary files /dev/null and b/public/errors/user_1@abc.com/7_error.png differ diff --git a/public/reports/login_ts/20140107155418.html b/public/reports/login_ts/20140107155418.html deleted file mode 100644 index db4194e..0000000 --- a/public/reports/login_ts/20140107155418.html +++ /dev/null @@ -1,11 +0,0 @@ -

Created at 20140107155433

- - - - - - - - -
Login Test Suite -
S.NoTest Case NoStatus
1TC001Pass: Incorrect Credentials
diff --git a/public/reports/login_ts/20140107160146.html b/public/reports/login_ts/20140107160146.html deleted file mode 100644 index 441a128..0000000 --- a/public/reports/login_ts/20140107160146.html +++ /dev/null @@ -1,11 +0,0 @@ -

Created at 20140107160202

- - - - - - - - -
Login Test Suite -
S.NoTest Case NoStatus
1TC001Pass: Incorrect Credentials
diff --git a/public/reports/login_ts/20140107171947.html b/public/reports/login_ts/20140107171947.html deleted file mode 100644 index 44faeb8..0000000 --- a/public/reports/login_ts/20140107171947.html +++ /dev/null @@ -1,11 +0,0 @@ -

Created at 20140107172000

- - - - - - - - -
Test Suite -
S.NoTest Case NoStatus
1TC001Pass: Incorrect Credentials
diff --git a/public/reports/login_ts/20140107180505.html b/public/reports/login_ts/20140107180505.html deleted file mode 100644 index 87bff39..0000000 --- a/public/reports/login_ts/20140107180505.html +++ /dev/null @@ -1,14 +0,0 @@ -

Created at 20140107180538

- - - - - - - - - - - -
Test Suite -
S.NoTest Case NoStatus
1TC001Pass: Incorrect Credentials
2TC002Pass: Correct Credentials
diff --git a/public/reports/login_ts/20140107182103.html b/public/reports/login_ts/20140107182103.html deleted file mode 100644 index cef0a2f..0000000 --- a/public/reports/login_ts/20140107182103.html +++ /dev/null @@ -1,14 +0,0 @@ -

Created at 20140107182141

- - - - - - - - - - - -
Test Suite -
S.NoTest Case NoStatus
1TC001Pass: Incorrect Credentials
2TC002Pass: Correct Credentials
diff --git a/public/reports/login_ts/20140116190410.html b/public/reports/login_ts/20140116190410.html deleted file mode 100644 index 966f347..0000000 --- a/public/reports/login_ts/20140116190410.html +++ /dev/null @@ -1,14 +0,0 @@ -

Created at 20140116190451

- - - - - - - - - - - -
Test Suite -
S.NoTest Case NoStatus
1TC001Pass: Incorrect Credentials
2TC002Pass: Correct Credentials
diff --git a/public/reports/login_ts/20140116191907.html b/public/reports/login_ts/20140116191907.html deleted file mode 100644 index 187f403..0000000 --- a/public/reports/login_ts/20140116191907.html +++ /dev/null @@ -1,14 +0,0 @@ -

Created at 20140116191938

- - - - - - - - - - - -
Test Suite -
S.NoTest Case NoStatus
1TC001Pass: Incorrect Credentials
2TC002Pass: Correct Credentials
diff --git a/public/reports/message_ts/20140107172524.html b/public/reports/message_ts/20140107172524.html deleted file mode 100644 index f9c95ca..0000000 --- a/public/reports/message_ts/20140107172524.html +++ /dev/null @@ -1,92 +0,0 @@ -

Created at 20140107172542

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Test Suite -
S.NoTest Case NoStatus
1TC001Code Reviews/TestCat Feedback Summary - Dec 2013
2TC002Free Lunch!
3TC003IT Seminar - OpSpec - Introduction to Jasper Reports - Jan 7 - NOIDA ADC
4TC004Year-to-Date (YTD) Performance - Dec 2013
5TC005Weekend Work
6TC006Fixed timing.
7TC007CTC Activities Dec 2013
8TC008Internal Training (IT) Seminar Activities – Dec 2013
9TC009Leaves2014 - Bonus!
10TC0010Fixed timing!
11TC0011IT Seminar - Test Data Management Framework - Jan 2 - NOIDA ADC
12TC0012Leaves and Holidays 2014
13TC0013Fixed timing?
14TC0014IT Seminar - OpSpec - Introduction to JavaFx Part-2 - Dec 26 - NOIDA ADC
15TC0015“Stars of the Month” November-2013
16TC0016IT Seminar - Selenium IDE and Locators - Dec 24 - NOIDA ADC
17TC0017IT Seminar - Introduction to Health Care Domain and Testing Challenges - Dec 23 - NOIDA ADC
18TC0018IT Seminar - XML Serialization in C# - Dec 20, Friday - BBSR ADC
19TC0019IT Seminar - Selinium Learning - Dec 18 - NOIDA ADC
20TC0020[OpSpec]-[PointCat] - MySql
21TC0021IT Seminar - Cloud testing-Vs-Testing a Cloud - Dec 16 - NOIDA ADC
22TC0022[ToolCat][TryMeOut] - LittleEye-Performance Analysis and Monitoring Tool for Android Developers
23TC0023Key Sales Information - November 2013
24TC0024IT Seminar - Testing Documentation - Dec 12 - NOIDA ADC
25TC0025Mindfire Reputation Activities November-2013
26TC0026IT Seminar - Introduction to ORM and its enhancements in CF10 - Dec 10, Tuesday - BGLR ADC
27TC0027IT Seminar - Filemaker 13 - A Synopsis - Dec 6 - BBSR ADC
28TC0028IT Seminar - Installers/Uninstallers for Windows using Inno Setup - Dec 6 - NOIDA ADC
29TC0029Year-to-Date (YTD) Performance - Nov 2013
30TC0030Code Reviews/TestCat Feedback Summary - Nov 2013
31TC0031IT Seminar - iOS 7.0 and Xcode 5.0 Updates - Dec 5 - NOIDA ADC
32TC0032CTC Activities Nov 2013
33TC0033IT Seminar - HTML 5 off-line functionality - Dec 4 - NOIDA ADC
34TC0034Internal Training (IT) Seminar Activities – Nov 2013
35TC0035Winners MT!C and Closure Note
36TC0036IT Seminar - Key challenges and types of mobile application testing - Dec 2 - NOIDA ADC
37TC0037Physical Greeting Cards, with Team-Photos, to All Customers!
38TC0038IT Seminar - Overview of MSCRM 2013 online fall - Nov 29 - BBSR ADC
39TC0039Mindfire is the "Fastest Growing SME" in India, in 2013
40TC0040IT Seminar - Show the different types of graph in MVC application - Nov 27 - NOIDA ADC
41TC0041IT Seminar - Do's and Don’ts in Jquery/JavaScript - Nov 27, Wednesday - BGLR ADC
diff --git a/public/reports/message_ts/20140107173027.html b/public/reports/message_ts/20140107173027.html deleted file mode 100644 index aef423b..0000000 --- a/public/reports/message_ts/20140107173027.html +++ /dev/null @@ -1,92 +0,0 @@ -

Created at 20140107173049

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Test Suite -
S.NoTest Case NoStatus
1TC001Code Reviews/TestCat Feedback Summary - Dec 2013
2TC002Free Lunch!
3TC003IT Seminar - OpSpec - Introduction to Jasper Reports - Jan 7 - NOIDA ADC
4TC004Year-to-Date (YTD) Performance - Dec 2013
5TC005Weekend Work
6TC006Fixed timing.
7TC007CTC Activities Dec 2013
8TC008Internal Training (IT) Seminar Activities – Dec 2013
9TC009Leaves2014 - Bonus!
10TC0010Fixed timing!
11TC0011IT Seminar - Test Data Management Framework - Jan 2 - NOIDA ADC
12TC0012Leaves and Holidays 2014
13TC0013Fixed timing?
14TC0014IT Seminar - OpSpec - Introduction to JavaFx Part-2 - Dec 26 - NOIDA ADC
15TC0015“Stars of the Month” November-2013
16TC0016IT Seminar - Selenium IDE and Locators - Dec 24 - NOIDA ADC
17TC0017IT Seminar - Introduction to Health Care Domain and Testing Challenges - Dec 23 - NOIDA ADC
18TC0018IT Seminar - XML Serialization in C# - Dec 20, Friday - BBSR ADC
19TC0019IT Seminar - Selinium Learning - Dec 18 - NOIDA ADC
20TC0020[OpSpec]-[PointCat] - MySql
21TC0021IT Seminar - Cloud testing-Vs-Testing a Cloud - Dec 16 - NOIDA ADC
22TC0022[ToolCat][TryMeOut] - LittleEye-Performance Analysis and Monitoring Tool for Android Developers
23TC0023Key Sales Information - November 2013
24TC0024IT Seminar - Testing Documentation - Dec 12 - NOIDA ADC
25TC0025Mindfire Reputation Activities November-2013
26TC0026IT Seminar - Introduction to ORM and its enhancements in CF10 - Dec 10, Tuesday - BGLR ADC
27TC0027IT Seminar - Filemaker 13 - A Synopsis - Dec 6 - BBSR ADC
28TC0028IT Seminar - Installers/Uninstallers for Windows using Inno Setup - Dec 6 - NOIDA ADC
29TC0029Year-to-Date (YTD) Performance - Nov 2013
30TC0030Code Reviews/TestCat Feedback Summary - Nov 2013
31TC0031IT Seminar - iOS 7.0 and Xcode 5.0 Updates - Dec 5 - NOIDA ADC
32TC0032CTC Activities Nov 2013
33TC0033IT Seminar - HTML 5 off-line functionality - Dec 4 - NOIDA ADC
34TC0034Internal Training (IT) Seminar Activities – Nov 2013
35TC0035Winners MT!C and Closure Note
36TC0036IT Seminar - Key challenges and types of mobile application testing - Dec 2 - NOIDA ADC
37TC0037Physical Greeting Cards, with Team-Photos, to All Customers!
38TC0038IT Seminar - Overview of MSCRM 2013 online fall - Nov 29 - BBSR ADC
39TC0039Mindfire is the "Fastest Growing SME" in India, in 2013
40TC0040IT Seminar - Show the different types of graph in MVC application - Nov 27 - NOIDA ADC
41TC0041IT Seminar - Do's and Don’ts in Jquery/JavaScript - Nov 27, Wednesday - BGLR ADC
diff --git a/public/reports/message_ts/20140107180558.html b/public/reports/message_ts/20140107180558.html deleted file mode 100644 index d3d6941..0000000 --- a/public/reports/message_ts/20140107180558.html +++ /dev/null @@ -1,92 +0,0 @@ -

Created at 20140107180625

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Test Suite -
S.NoTest Case NoStatus
1TC001Code Reviews/TestCat Feedback Summary - Dec 2013
2TC002Free Lunch!
3TC003IT Seminar - OpSpec - Introduction to Jasper Reports - Jan 7 - NOIDA ADC
4TC004Year-to-Date (YTD) Performance - Dec 2013
5TC005Weekend Work
6TC006Fixed timing.
7TC007CTC Activities Dec 2013
8TC008Internal Training (IT) Seminar Activities – Dec 2013
9TC009Leaves2014 - Bonus!
10TC0010Fixed timing!
11TC0011IT Seminar - Test Data Management Framework - Jan 2 - NOIDA ADC
12TC0012Leaves and Holidays 2014
13TC0013Fixed timing?
14TC0014IT Seminar - OpSpec - Introduction to JavaFx Part-2 - Dec 26 - NOIDA ADC
15TC0015“Stars of the Month” November-2013
16TC0016IT Seminar - Selenium IDE and Locators - Dec 24 - NOIDA ADC
17TC0017IT Seminar - Introduction to Health Care Domain and Testing Challenges - Dec 23 - NOIDA ADC
18TC0018IT Seminar - XML Serialization in C# - Dec 20, Friday - BBSR ADC
19TC0019IT Seminar - Selinium Learning - Dec 18 - NOIDA ADC
20TC0020[OpSpec]-[PointCat] - MySql
21TC0021IT Seminar - Cloud testing-Vs-Testing a Cloud - Dec 16 - NOIDA ADC
22TC0022[ToolCat][TryMeOut] - LittleEye-Performance Analysis and Monitoring Tool for Android Developers
23TC0023Key Sales Information - November 2013
24TC0024IT Seminar - Testing Documentation - Dec 12 - NOIDA ADC
25TC0025Mindfire Reputation Activities November-2013
26TC0026IT Seminar - Introduction to ORM and its enhancements in CF10 - Dec 10, Tuesday - BGLR ADC
27TC0027IT Seminar - Filemaker 13 - A Synopsis - Dec 6 - BBSR ADC
28TC0028IT Seminar - Installers/Uninstallers for Windows using Inno Setup - Dec 6 - NOIDA ADC
29TC0029Year-to-Date (YTD) Performance - Nov 2013
30TC0030Code Reviews/TestCat Feedback Summary - Nov 2013
31TC0031IT Seminar - iOS 7.0 and Xcode 5.0 Updates - Dec 5 - NOIDA ADC
32TC0032CTC Activities Nov 2013
33TC0033IT Seminar - HTML 5 off-line functionality - Dec 4 - NOIDA ADC
34TC0034Internal Training (IT) Seminar Activities – Nov 2013
35TC0035Winners MT!C and Closure Note
36TC0036IT Seminar - Key challenges and types of mobile application testing - Dec 2 - NOIDA ADC
37TC0037Physical Greeting Cards, with Team-Photos, to All Customers!
38TC0038IT Seminar - Overview of MSCRM 2013 online fall - Nov 29 - BBSR ADC
39TC0039Mindfire is the "Fastest Growing SME" in India, in 2013
40TC0040IT Seminar - Show the different types of graph in MVC application - Nov 27 - NOIDA ADC
41TC0041IT Seminar - Do's and Don’ts in Jquery/JavaScript - Nov 27, Wednesday - BGLR ADC
diff --git a/public/reports/message_ts/20140107182336.html b/public/reports/message_ts/20140107182336.html deleted file mode 100644 index 4092ea6..0000000 --- a/public/reports/message_ts/20140107182336.html +++ /dev/null @@ -1,92 +0,0 @@ -

Created at 20140107182358

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Test Suite -
S.NoTest Case NoStatus
1TC001Code Reviews/TestCat Feedback Summary - Dec 2013
2TC002Free Lunch!
3TC003IT Seminar - OpSpec - Introduction to Jasper Reports - Jan 7 - NOIDA ADC
4TC004Year-to-Date (YTD) Performance - Dec 2013
5TC005Weekend Work
6TC006Fixed timing.
7TC007CTC Activities Dec 2013
8TC008Internal Training (IT) Seminar Activities – Dec 2013
9TC009Leaves2014 - Bonus!
10TC0010Fixed timing!
11TC0011IT Seminar - Test Data Management Framework - Jan 2 - NOIDA ADC
12TC0012Leaves and Holidays 2014
13TC0013Fixed timing?
14TC0014IT Seminar - OpSpec - Introduction to JavaFx Part-2 - Dec 26 - NOIDA ADC
15TC0015“Stars of the Month” November-2013
16TC0016IT Seminar - Selenium IDE and Locators - Dec 24 - NOIDA ADC
17TC0017IT Seminar - Introduction to Health Care Domain and Testing Challenges - Dec 23 - NOIDA ADC
18TC0018IT Seminar - XML Serialization in C# - Dec 20, Friday - BBSR ADC
19TC0019IT Seminar - Selinium Learning - Dec 18 - NOIDA ADC
20TC0020[OpSpec]-[PointCat] - MySql
21TC0021IT Seminar - Cloud testing-Vs-Testing a Cloud - Dec 16 - NOIDA ADC
22TC0022[ToolCat][TryMeOut] - LittleEye-Performance Analysis and Monitoring Tool for Android Developers
23TC0023Key Sales Information - November 2013
24TC0024IT Seminar - Testing Documentation - Dec 12 - NOIDA ADC
25TC0025Mindfire Reputation Activities November-2013
26TC0026IT Seminar - Introduction to ORM and its enhancements in CF10 - Dec 10, Tuesday - BGLR ADC
27TC0027IT Seminar - Filemaker 13 - A Synopsis - Dec 6 - BBSR ADC
28TC0028IT Seminar - Installers/Uninstallers for Windows using Inno Setup - Dec 6 - NOIDA ADC
29TC0029Year-to-Date (YTD) Performance - Nov 2013
30TC0030Code Reviews/TestCat Feedback Summary - Nov 2013
31TC0031IT Seminar - iOS 7.0 and Xcode 5.0 Updates - Dec 5 - NOIDA ADC
32TC0032CTC Activities Nov 2013
33TC0033IT Seminar - HTML 5 off-line functionality - Dec 4 - NOIDA ADC
34TC0034Internal Training (IT) Seminar Activities – Nov 2013
35TC0035Winners MT!C and Closure Note
36TC0036IT Seminar - Key challenges and types of mobile application testing - Dec 2 - NOIDA ADC
37TC0037Physical Greeting Cards, with Team-Photos, to All Customers!
38TC0038IT Seminar - Overview of MSCRM 2013 online fall - Nov 29 - BBSR ADC
39TC0039Mindfire is the "Fastest Growing SME" in India, in 2013
40TC0040IT Seminar - Show the different types of graph in MVC application - Nov 27 - NOIDA ADC
41TC0041IT Seminar - Do's and Don’ts in Jquery/JavaScript - Nov 27, Wednesday - BGLR ADC
diff --git a/startup.rb b/startup.rb new file mode 100644 index 0000000..f63f59f --- /dev/null +++ b/startup.rb @@ -0,0 +1,4 @@ +pid1 = Process.spawn('rackup faye.ru -E production -s thin') +puts "Faye running, PID : #{pid1}" +pid2 = Process.spawn('bundle exec sidekiq --config ./config/sidekiq.yml') +puts "Sidekiq running, PID : #{pid2}" \ No newline at end of file diff --git a/test/fixtures/executions.yml b/test/fixtures/jobs.yml similarity index 69% rename from test/fixtures/executions.yml rename to test/fixtures/jobs.yml index 8642037..025daf2 100644 --- a/test/fixtures/executions.yml +++ b/test/fixtures/jobs.yml @@ -6,7 +6,8 @@ one: test_id: 1 test_step_id: 1 status: MyString - last_run: + start_time: 2014-02-13 16:15:54 + finish_time: MyString two: user_id: 1 @@ -14,4 +15,5 @@ two: test_id: 1 test_step_id: 1 status: MyString - last_run: + start_time: 2014-02-13 16:15:54 + finish_time: MyString diff --git a/test/fixtures/login_test_data.yml b/test/fixtures/login_test_data.yml deleted file mode 100644 index 0a7bb26..0000000 --- a/test/fixtures/login_test_data.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -one: - email: MyString - password: MyString - check: false - -two: - email: MyString - password: MyString - check: false diff --git a/test/fixtures/queue_carts.yml b/test/fixtures/queue_carts.yml deleted file mode 100644 index f2ae3dc..0000000 --- a/test/fixtures/queue_carts.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -one: - test_suite_id: 1 - test_id: 1 - test_step_id: 1 - -two: - test_suite_id: 1 - test_id: 1 - test_step_id: 1 diff --git a/test/fixtures/exec_progresses.yml b/test/fixtures/reports.yml similarity index 54% rename from test/fixtures/exec_progresses.yml rename to test/fixtures/reports.yml index c9ac9ed..f3e0c5e 100644 --- a/test/fixtures/exec_progresses.yml +++ b/test/fixtures/reports.yml @@ -1,13 +1,13 @@ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html one: + name: MyString + job_id: 1 user_id: 1 - test_id: 1 - test_step_id: 1 - status: MyString + description: MyString two: + name: MyString + job_id: 1 user_id: 1 - test_id: 1 - test_step_id: 1 - status: MyString + description: MyString diff --git a/test/models/exec_progress_test.rb b/test/models/exec_progress_test.rb deleted file mode 100644 index 7342046..0000000 --- a/test/models/exec_progress_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class ExecProgressTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/models/queue_cart_test.rb b/test/models/job_test.rb similarity index 62% rename from test/models/queue_cart_test.rb rename to test/models/job_test.rb index 428b0a5..5079316 100644 --- a/test/models/queue_cart_test.rb +++ b/test/models/job_test.rb @@ -1,6 +1,6 @@ require 'test_helper' -class QueueCartTest < ActiveSupport::TestCase +class JobTest < ActiveSupport::TestCase # test "the truth" do # assert true # end diff --git a/test/models/login_test_data_test.rb b/test/models/login_test_data_test.rb deleted file mode 100644 index f7c21ae..0000000 --- a/test/models/login_test_data_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class LoginTestDataTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/models/execution_test.rb b/test/models/report_test.rb similarity index 62% rename from test/models/execution_test.rb rename to test/models/report_test.rb index 17b2924..198d9dd 100644 --- a/test/models/execution_test.rb +++ b/test/models/report_test.rb @@ -1,6 +1,6 @@ require 'test_helper' -class ExecutionTest < ActiveSupport::TestCase +class ReportTest < ActiveSupport::TestCase # test "the truth" do # assert true # end