How to use create method of AcceptanceTests Package

Best Shoulda_ruby code snippet using AcceptanceTests.create

rakeFile_PBSUATBSOCI1.rb

Source:rakeFile_PBSUATBSOCI1.rb Github

copy

Full Screen

...46 # handle e47 end 48end49desc "Create IIS"50iissetup :create_iis do |d|51 d.path = "\"#{srcpath}\\BusinessSafe.WebSite\""52 d.apppoolname = "businesssafe"53 d.pipeline = "Integrated"54 d.site = "businesssafe"55 d.port = "8070"56 d.deploy_to = :website57end58desc "Build"59msbuild :build do |msb|60 msb.properties :configuration => :Debug61 msb.targets :Clean, :Build62 msb.solution = "BusinessSafe.sln"63end64desc "Test" 65nunit :test do |nunit|66 nunit.command = "ThirdParty/NUnit/nunit-console.exe"67 nunit.assemblies "BusinessSafe.WebSite.Test/bin/Debug/BusinessSafe.WebSite.Tests.dll", 68 "BusinessSafe.Application.Tests/bin/Debug/BusinessSafe.Application.Tests.dll",69 "BusinessSafe.Test.Infrastructure/bin/Debug/BusinessSafe.Test.Infrastructure.dll",70 "BusinessSafe.Domain.Tests/bin/Debug/BusinessSafe.Domain.Tests.dll",71 "BusinessSafe.Data.Tests/bin/Debug/BusinessSafe.Data.Tests.dll" ,72 "BusinessSafe.Checklists.Test/bin/Debug/BusinessSafe.Checklists.Test.dll", 73 "BusinessSafe.MessageHandlers.Emails.Test/bin/Debug/BusinessSafe.MessageHandlers.Emails.Test.dll", 74 "BusinessSafe.MessageHandlers.Test/bin/Debug/BusinessSafe.MessageHandlers.Test.dll" 75 76 nunit.options '/xml=UnitTestsResults.xml'77end78desc "Acceptance Tests"79nunit :acceptancetest do |nunit|80 print "Acceptance Test\n"81 nunit.command = "ThirdParty/NUnit/nunit-console.exe"82 nunit.options '/nothread /exclude:finetune /xml=AcceptanceTestsResults.xml'83 nunit.assemblies "AcceptanceTests/bin/Debug/BusinessSafe.AcceptanceTests.dll"84end85desc "FineTune Acceptance Tests Only"86nunit :performFineTuneTests do |nunit|87 nunit.command = "ThirdParty/NUnit/nunit-console.exe"88 nunit.options '/include:finetune /xml=FineTuneTestsResults.xml'89 nunit.assemblies "AcceptanceTests/bin/Debug/BusinessSafe.AcceptanceTests.dll"90end91desc "Create the BusinessSafe database known context"92 sqlcmd :create_businesssafe_database_known_context do |sql|93 script_CreateBusinessSafeDatabaseKnownContext = "SQLScripts\\BusinessSafeBaseData.sql"94 server = "UATSQL2"95 database = "master"96 sql.command = "sqlcmd.exe"97 sql.server = server98 sql.database = database 99 sql.scripts script_CreateBusinessSafeDatabaseKnownContext100end101desc "DBDeploy"102task :dbdeploy do103 system "#{"nant -buildfile:DBDeploy_Local.build -D:Target.BusinessSafe.SQLServer=UATSQL2 -D:Target.BusinessSafe.SQLServer.Filename=UATSQL2"}"104end 105task :dbsetup => [:create_initial_db,:dbdeploy,:create_businesssafe_database_known_context]106desc "Create the initial BusinessSafe database"107 sqlcmd :create_initial_db do |sql|108 script_CreateUser = "SQLScripts\\CREATE Security Login - intranetadmin.sql"109 script_dbsetup = "SQLScripts\\CREATE BusinessSafe database.PBSUATSQL3.sql"110 script_AddChangeLog = "SQLScripts\\CREATE ChangeLog table - BusinessSafe.sql"111 server = "UATSQL2"112 database = "master"113 sql.command = "sqlcmd.exe"114 sql.server = server115 sql.database = database 116 sql.scripts script_dbsetup, script_CreateUser, script_AddChangeLog 117end118desc "Deploy"119task :deploy => [:deployBusinessSafe, :deployBusinessSafeChecklists]120task :deployBusinessSafe do |cmd|121 system "rd #{deploypath} /s /q"122 FileUtils.mkdir_p("#{deploypath}")123 system "xcopy #{srcpath}\\BusinessSafe.Website\ #{deploypath} /e /y"124 system "xcopy #{srcpath}\\packages\\WatiN.2.1.0\\lib\\net40 #{srcpath}\\AcceptanceTests\\bin\\Debug /e /y" 125 system "xcopy #{srcpath}\\packages\\MvcContrib.2.0.95.0\\lib #{srcpath}\\AcceptanceTests\\bin\\Debug /e /y" 126 127 system "rd #{messagehandlerdeploypath} /s /q"128 FileUtils.mkdir_p("#{messagehandlerdeploypath}")129 system "xcopy #{srcpath}\\BusinessSafe.MessageHandlers\ #{messagehandlerdeploypath} /e /y"130 system "rd #{businesssafemessagehandlersemailsdeploypath} /s /q"131 FileUtils.mkdir_p("#{businesssafemessagehandlersemailsdeploypath}")132 system "xcopy #{srcpath}\\BusinessSafe.MessageHandlers.Emails\ #{businesssafemessagehandlersemailsdeploypath} /e /y"133end134task :deployBusinessSafeChecklists do |cmd|135 system "rd #{checklistsDeployPath} /s /q"136 FileUtils.mkdir_p("#{checklistsDeployPath}")137 system "xcopy #{srcpath}\\BusinessSafe.Checklists\ #{checklistsDeployPath} /e /y"138end139task :removeAndCreateCIPublishDir => [:removeAndCreateBusinessSafeCIPublishDir, :removeAndCreateBusinessSafeChecklistsCIPublishDir]140desc "Removes and recreates BusinessSafe CI publish directory"141task :removeAndCreateBusinessSafeCIPublishDir do142 print "Removing CI publish directory \n"143 system "rd #{BusinessSafeCIPublishDirectory} /s /q"144 print "Creating CI publish directory \n"145 FileUtils.mkdir_p("#{BusinessSafeCIPublishDirectory}")146end147desc "Removes and recreates BusinessSafe Checklists CI publish directory"148task :removeAndCreateBusinessSafeChecklistsCIPublishDir do149 print "Removing Checklists CI publish directory \n"150 system "rd #{BusinessSafeChecklistsCIPublishDirectory} /s /q"151 print "Creating Checklists CI publish directory \n"152 FileUtils.mkdir_p("#{BusinessSafeChecklistsCIPublishDirectory}")153end154task :publishCI => [:publishBusinessSafeCI, :publishBusinessSafeChecklistsCI]155desc "Publishes site in CI configuration"156msbuild :publishBusinessSafeCI do |msb|157 print "Publishes site in CI configuration \n"158 msb.properties :configuration => :Release, 159 :webprojectoutputdir => BusinessSafeCIPublishPath, 160 :outdir => BusinessSafeCIPublishPath + "bin/" 161 msb.targets :Clean, :Build...

Full Screen

Full Screen

step_helpers.rb

Source:step_helpers.rb Github

copy

Full Screen

...6 include FileHelpers7 include GemHelpers8 include MinitestHelpers9 extend RSpec::Matchers::DSL10 def create_active_model_project11 create_generic_bundler_project12 add_gem 'activemodel', active_model_version13 end14 def create_generic_bundler_project15 fs.create16 run_command! 'bundle init'17 end18 def add_shoulda_matchers_to_project(options = {})19 gem_options = { path: fs.root_directory }20 if options[:manually]21 gem_options[:require] = false22 end23 add_gem 'shoulda-matchers', gem_options24 if options[:manually]25 if options[:test_frameworks].include?(:rspec)26 append_to_file spec_helper_file_path, "require 'shoulda/matchers'"27 end28 if options[:test_frameworks].include?(:n_unit)29 append_to_file 'test/test_helper.rb', "require 'shoulda/matchers'"30 end31 end32 end33 def add_minitest_to_project34 add_gem 'minitest-reporters'35 append_to_file 'test/test_helper.rb', <<-FILE36 require 'minitest/autorun'37 require 'minitest/reporters'38 Minitest::Reporters.use!(Minitest::Reporters::SpecReporter.new)39 FILE40 end41 def add_shoulda_context_to_project(options = {})42 add_gem 'shoulda-context'43 if options[:manually]44 append_to_file 'test/test_helper.rb', <<-FILE45 require 'shoulda/context'46 FILE47 end48 end49 def write_minitest_test(path)50 contents = yield minitest_test_case_superclass51 write_file(path, contents)52 end53 def run_n_unit_tests(*paths)54 run_command_within_bundle 'ruby -I lib -I test', *paths55 end56 def run_n_unit_test_suite57 run_rake_tasks('test', env: { TESTOPTS: '-v' })58 end59 def create_rails_application60 command = "bundle exec rails new #{fs.project_directory} --skip-bundle"61 run_command!(command) do |runner|62 runner.directory = nil63 end64 updating_bundle do |bundle|65 bundle.remove_gem 'turn'66 bundle.remove_gem 'coffee-rails'67 bundle.remove_gem 'uglifier'68 end69 end70 def configure_routes_with_single_wildcard_route71 write_file 'config/routes.rb', <<-FILE72 Rails.application.routes.draw do73 get ':controller(/:action(/:id(.:format)))'...

Full Screen

Full Screen

Rakefile

Source:Rakefile Github

copy

Full Screen

1require 'physique'2# Reports version information about the build to TeamCity. If you are not 3# using TeamCity, you should delete this line.4require 'albacore/ext/teamcity' 5Physique::Solution.new do |s|6 s.file = 'src/__NAME__.sln'7 s.run_tests do |t|8 # Find all assemblies ending in 'Tests' excluding 'AcceptanceTests'.9 t.files = FileList["**/*Tests/bin/Release/*Tests.dll"].exclude(/AcceptanceTests.dll$/)10 end11 # Sets up the FluentMigrator workflow tasks for your database project.12 s.database do |db|13 db.instance = ENV['DATABASE_SERVER'] || 'localhost'14 db.name = ENV['DATABASE_NAME'] || '__NAME__'15 db.project = '__NAME__.Database'16 end17 # Publish the Api, MessageBus, and Database projects to Octopus Deploy. If 18 # you are not using Octopus Deploy you should delete this section.19 s.octopus_deploy do |octo|20 octo.server = 'http://build/nuget/packages'21 octo.api_key = ENV['OCTOPUS_API_KEY']22 octo.deploy_app do |app|23 app.name = 'database'24 app.type = :console25 app.project = '__NAME__.Database'26 app.with_metadata do |m|27 m.description = '__NAME__ Database Migrations'28 m.authors = 'Third Wave Technology'29 end30 end31 octo.deploy_app do |app|32 app.name = 'web'33 app.type = :website34 app.project = '__NAME__.Api'35 app.with_metadata do |m|36 m.description = '__NAME__ Api'37 m.authors = 'Third Wave Technology'38 end39 end40 octo.deploy_app do |app|41 app.name = 'messagebus'42 app.type = :console43 app.project = '__NAME__.MessageBus'44 app.with_metadata do |m|45 m.description = '__NAME__ Message Bus'46 m.authors = 'Third Wave Technology'47 end48 end49 end50end51desc 'Runs the continuous integration build'52task :ci => [:versionizer, :test] # Add any steps you want included in your CI 53 # build here.54desc 'Runs the acceptance tests'55test_runner :acceptance do |t|56 t.files = FileList["**/*.AcceptanceTests/bin/Release/*.AcceptanceTests.dll"]57 t.exe = 'src/packages/NUnit.Runners.2.6.3/tools/nunit-console.exe'58 %w(/labels /trace=Verbose).each { |p| t.parameters.add p }59end60self.extend Physique::DSL61desc 'Create SQL login for IIS app pool'62sqlcmd :init_app_pool_login do |c|63 c.server_name = ENV['DATABASE_SERVER'] || 'localhost'64 c.database_name = ENV['DATABASE_NAME'] || '__NAME__'65 c.file = 'init_app_pool_login.sql'66end...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Shoulda_ruby automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful