SlideShare una empresa de Scribd logo
1 de 34
Automated builds and UI testing in Sp2010 development Chris O’Brien DEV203
About me Independent SharePoint consultant Blog: www.sharepointnutsandbolts.com Twitter: @ChrisO_Brien Book: Real World SharePoint 2010 (20 MVPs) LinkedIn: http://uk.linkedin.com/in/chrisobrienmvp
Problems in SP2010 dev projects Many dependencies Code, Features, timer jobs Deployment is complex e.g. No native support for WSP rollback Difficult to unit test Still not much traction in SharePoint world?
Problems in *large* SP2010 dev projects Tracking Hard to keep track of deployments/fixes Many developers = many deployments? Inefficiency Devs keeping environment up-to-date Inconsistent builds (or buildmaster bottleneck) Silly mistakes e.g. Incorrect versions Debug vs. Release mode Testing of actual WSPs Communication
Solution recipe Auto-compile of assemblies and build of WSPs Correct versions in source control Add a label in source control to help rollback Auto incrementing assembly version number Better tracking of deployments/fixes etc. Deployment of WSPs to remote SharePoint 2010 environment Test environment, not developer machine UI testing Build fails on UI test failure Developer notifications
Solution ingredients TFS Team Build workflow (.Net4.0) Specifies sequence of steps PowerShell Deploys WSPs, other deployment steps e.g. teardown/setup site PowerShell remoting(preferred over PsExec) Allows PS on SharePoint box to be called from build server Invoke-Command -ComputerName “foo” { script }
Automating the build
Build definition Styles: What’s the trigger? Manual, Scheduled (e.g. nightly), every check-in, Rolling builds, Gated Check-In etc. Customise workflow Mandatory for SharePoint builds Several workflows OOTB DefaultTemplate, LabTemplate
demo Automating the build
Image: selecting build trigger
Image: customizing build workflow
COdedui tests
What is a coded UI test? Recorded on test agent desktop Support: browser (inc. AJAX), Silverlight, WPF, forms apps Generate code which can be modified (e.g. to pass data) Point and click to add assertions E.g. navigate to web part gallery, check web part present
demo Testing SharePoint with coded UI tests
Image: recording a UI test
Adding COdedui tests to the build
Integrating coded UI tests into build Automatic if test assembly name matches filespec Default = “*test*” somewhere in assembly name Background: All tests can be run from command-line with MSTest.exe (Unit tests, Coded UI tests, Load tests, Etc.) Team Build ships with MSTest WF activity (wrapper) The OOTB workflows contain this activity Caveat: OOTB workflows must be edited to deploy WSPs and/or run coded UI tests
demo Catching code issues with build/test process
Image: build summary
Image: test results for build
Image: analyzing failed test (1)
Image: analyzing failed test (2)
Why stop at UI testing?
Image: code profiling in build (1)
Image: code profiling in build (2)
Image: IntelliTrace in build
Best practices Start on day 0 of project Retro-fitting can be expensive Get fast feedback - have a lightweight/quick build run on check-in Compile all projects/build WSPs Suggestion - every SharePoint project should do this much Increment assembly versions (FileVersion) with label generated by build Leverage UI testing (with or without automated builds)
Resources Setting up TFS to build SharePoint Projects - http://bit.ly/9lEqnP Assembly versions in build workflow - http://bit.ly/eRPB0e Running tests as part of a build - http://bit.ly/i41eze PS remoting and SharePoint 2010 - http://bit.ly/9Cb4tF Also on my blog soon: My customized workflow and PS scripts Multi-part article series on automated builds/testing www.sharepointnutsandbolts.com
Thank you!
Appendix slides
What you need - software Automated builds = TFS 2010 (Team Build) Server + 1 CAL free with every MSDN level Need CAL for every user who interacts Components: Build Controller, Build Agent Coded UI tests = Visual Studio 2010 Premium/Ultimate (OR ‘Test Elements’ add-on) Components: Test Controller, Test Agent
What you need - hardware Option 1 – the EASY button Disadvantages: Risk to source control Performance SP2010 + TFS2010 = big resource reqs Bottom line: Don’t do this with prod source control!
What you need - hardware Option 2 – a sample topology
PowerShell remoting To enable: To run: Invoke-Command -ComputerName“foo” { script }

Más contenido relacionado

La actualidad más candente

2013 10-28 php ug presentation - ci using phing and hudson
2013 10-28 php ug presentation - ci using phing and hudson2013 10-28 php ug presentation - ci using phing and hudson
2013 10-28 php ug presentation - ci using phing and hudsonShreeniwas Iyer
 
VS2015 C++ new features
VS2015 C++ new featuresVS2015 C++ new features
VS2015 C++ new features명신 김
 
Part 2 improving your software development v1.0
Part 2   improving your software development v1.0Part 2   improving your software development v1.0
Part 2 improving your software development v1.0Jasmine Conseil
 
Improve Development Process with Open Source Software
Improve Development Process with Open Source SoftwareImprove Development Process with Open Source Software
Improve Development Process with Open Source Softwareelliando dias
 
Trying to Sell PVS-Studio to Google, or New Bugs in Chromium
Trying to Sell PVS-Studio to Google, or New Bugs in ChromiumTrying to Sell PVS-Studio to Google, or New Bugs in Chromium
Trying to Sell PVS-Studio to Google, or New Bugs in ChromiumAndrey Karpov
 
Basics of Selenium IDE,Core, Remote Control
Basics of Selenium IDE,Core, Remote ControlBasics of Selenium IDE,Core, Remote Control
Basics of Selenium IDE,Core, Remote Controlusha kannappan
 
Web Test Automation with Selenium
Web Test Automation with SeleniumWeb Test Automation with Selenium
Web Test Automation with Seleniumvivek_prahlad
 
Selenium- A Software Testing Tool
Selenium- A Software Testing ToolSelenium- A Software Testing Tool
Selenium- A Software Testing ToolZeba Tahseen
 
Test Automation Using Selenium
Test Automation Using SeleniumTest Automation Using Selenium
Test Automation Using SeleniumNikhil Kapoor
 
Selenium IDE Introduction, Installation and Working
Selenium IDE Introduction, Installation and WorkingSelenium IDE Introduction, Installation and Working
Selenium IDE Introduction, Installation and WorkingDisha Srivastava
 
Automating development-operations-v1
Automating development-operations-v1Automating development-operations-v1
Automating development-operations-v1Sumanth Vepa
 
Improving code quality using CI
Improving code quality using CIImproving code quality using CI
Improving code quality using CIMartin de Keijzer
 
Continuous Quality Assurance using Selenium WebDriver
Continuous Quality Assurance using Selenium WebDriverContinuous Quality Assurance using Selenium WebDriver
Continuous Quality Assurance using Selenium WebDriverAOE
 
Unit Test Android Without Going Bald
Unit Test Android Without Going BaldUnit Test Android Without Going Bald
Unit Test Android Without Going BaldDavid Carver
 
Jenkins – przyjaciel każdego testera.
Jenkins – przyjaciel każdego testera.Jenkins – przyjaciel każdego testera.
Jenkins – przyjaciel każdego testera.Future Processing
 
Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...
Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...
Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...Edureka!
 
Automated UI testing done right (DDDSydney)
Automated UI testing done right (DDDSydney)Automated UI testing done right (DDDSydney)
Automated UI testing done right (DDDSydney)Mehdi Khalili
 
Selenium training course_content_3_days
Selenium training course_content_3_daysSelenium training course_content_3_days
Selenium training course_content_3_dayssayhi2sudarshan
 

La actualidad más candente (20)

2013 10-28 php ug presentation - ci using phing and hudson
2013 10-28 php ug presentation - ci using phing and hudson2013 10-28 php ug presentation - ci using phing and hudson
2013 10-28 php ug presentation - ci using phing and hudson
 
VS2015 C++ new features
VS2015 C++ new featuresVS2015 C++ new features
VS2015 C++ new features
 
Part 2 improving your software development v1.0
Part 2   improving your software development v1.0Part 2   improving your software development v1.0
Part 2 improving your software development v1.0
 
Improve Development Process with Open Source Software
Improve Development Process with Open Source SoftwareImprove Development Process with Open Source Software
Improve Development Process with Open Source Software
 
Trying to Sell PVS-Studio to Google, or New Bugs in Chromium
Trying to Sell PVS-Studio to Google, or New Bugs in ChromiumTrying to Sell PVS-Studio to Google, or New Bugs in Chromium
Trying to Sell PVS-Studio to Google, or New Bugs in Chromium
 
Basics of Selenium IDE,Core, Remote Control
Basics of Selenium IDE,Core, Remote ControlBasics of Selenium IDE,Core, Remote Control
Basics of Selenium IDE,Core, Remote Control
 
Web Test Automation with Selenium
Web Test Automation with SeleniumWeb Test Automation with Selenium
Web Test Automation with Selenium
 
Selenium- A Software Testing Tool
Selenium- A Software Testing ToolSelenium- A Software Testing Tool
Selenium- A Software Testing Tool
 
Test Automation Using Selenium
Test Automation Using SeleniumTest Automation Using Selenium
Test Automation Using Selenium
 
Selenium IDE Introduction, Installation and Working
Selenium IDE Introduction, Installation and WorkingSelenium IDE Introduction, Installation and Working
Selenium IDE Introduction, Installation and Working
 
BDD using Cucumber JVM
BDD using Cucumber JVMBDD using Cucumber JVM
BDD using Cucumber JVM
 
QSpiders - Automation using Selenium
QSpiders - Automation using SeleniumQSpiders - Automation using Selenium
QSpiders - Automation using Selenium
 
Automating development-operations-v1
Automating development-operations-v1Automating development-operations-v1
Automating development-operations-v1
 
Improving code quality using CI
Improving code quality using CIImproving code quality using CI
Improving code quality using CI
 
Continuous Quality Assurance using Selenium WebDriver
Continuous Quality Assurance using Selenium WebDriverContinuous Quality Assurance using Selenium WebDriver
Continuous Quality Assurance using Selenium WebDriver
 
Unit Test Android Without Going Bald
Unit Test Android Without Going BaldUnit Test Android Without Going Bald
Unit Test Android Without Going Bald
 
Jenkins – przyjaciel każdego testera.
Jenkins – przyjaciel każdego testera.Jenkins – przyjaciel każdego testera.
Jenkins – przyjaciel każdego testera.
 
Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...
Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...
Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...
 
Automated UI testing done right (DDDSydney)
Automated UI testing done right (DDDSydney)Automated UI testing done right (DDDSydney)
Automated UI testing done right (DDDSydney)
 
Selenium training course_content_3_days
Selenium training course_content_3_daysSelenium training course_content_3_days
Selenium training course_content_3_days
 

Similar a Automated Builds And UI Testing in SharePoint 2010 Development

Testing SharePoint solutions overview
Testing SharePoint solutions overviewTesting SharePoint solutions overview
Testing SharePoint solutions overviewSpiffy
 
Improving Software Quality- 2-day Tester Training
Improving Software Quality- 2-day Tester TrainingImproving Software Quality- 2-day Tester Training
Improving Software Quality- 2-day Tester TrainingAnna Russo
 
SharePoint Developer Experience Present & Future
SharePoint Developer Experience Present & FutureSharePoint Developer Experience Present & Future
SharePoint Developer Experience Present & Futuremattbremer
 
Full Testing Experience - Visual Studio and TFS 2010
 Full Testing Experience - Visual Studio and TFS 2010 Full Testing Experience - Visual Studio and TFS 2010
Full Testing Experience - Visual Studio and TFS 2010Ed Blankenship
 
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0Antonio Chagoury
 
Whats New In 2010 (Msdn & Visual Studio)
Whats New In 2010 (Msdn & Visual Studio)Whats New In 2010 (Msdn & Visual Studio)
Whats New In 2010 (Msdn & Visual Studio)Steve Lange
 
Overview of Visual Studio Team System 2010
Overview of Visual Studio Team System 2010Overview of Visual Studio Team System 2010
Overview of Visual Studio Team System 2010joycsc
 
Lap Around Visual Studio 2010 Ultimate And TFS 2010
Lap Around Visual Studio 2010 Ultimate And TFS 2010Lap Around Visual Studio 2010 Ultimate And TFS 2010
Lap Around Visual Studio 2010 Ultimate And TFS 2010Ed Blankenship
 
DevOps and Build Automation
DevOps and Build AutomationDevOps and Build Automation
DevOps and Build AutomationHeiswayi Nrird
 
Continuous Integration: How I stopped guessing if that merge was bad
Continuous Integration: How I stopped guessing if that merge was badContinuous Integration: How I stopped guessing if that merge was bad
Continuous Integration: How I stopped guessing if that merge was badJoe Ferguson
 
Automated Build using teamcity
Automated Build using teamcityAutomated Build using teamcity
Automated Build using teamcityMd Jawed
 
Continuous Everything
Continuous EverythingContinuous Everything
Continuous EverythingAndrea Tino
 
Jeremy thake introducing alm to share point development implementations (ap...
Jeremy thake   introducing alm to share point development implementations (ap...Jeremy thake   introducing alm to share point development implementations (ap...
Jeremy thake introducing alm to share point development implementations (ap...Jeremy Thake
 
Lab Management with TFS 2010
Lab Management with TFS 2010Lab Management with TFS 2010
Lab Management with TFS 2010Ed Blankenship
 
Visual Studio 2010 for SharePoint Developers
Visual Studio 2010 for SharePoint DevelopersVisual Studio 2010 for SharePoint Developers
Visual Studio 2010 for SharePoint Developersosullish
 
STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...Anna Russo
 
Playing in the SharePoint SandBox
Playing in the SharePoint SandBoxPlaying in the SharePoint SandBox
Playing in the SharePoint SandBoxToni Frankola
 

Similar a Automated Builds And UI Testing in SharePoint 2010 Development (20)

Testing SharePoint solutions overview
Testing SharePoint solutions overviewTesting SharePoint solutions overview
Testing SharePoint solutions overview
 
Improving Software Quality- 2-day Tester Training
Improving Software Quality- 2-day Tester TrainingImproving Software Quality- 2-day Tester Training
Improving Software Quality- 2-day Tester Training
 
SharePoint Developer Experience Present & Future
SharePoint Developer Experience Present & FutureSharePoint Developer Experience Present & Future
SharePoint Developer Experience Present & Future
 
Full Testing Experience - Visual Studio and TFS 2010
 Full Testing Experience - Visual Studio and TFS 2010 Full Testing Experience - Visual Studio and TFS 2010
Full Testing Experience - Visual Studio and TFS 2010
 
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0
 
Whats New In 2010 (Msdn & Visual Studio)
Whats New In 2010 (Msdn & Visual Studio)Whats New In 2010 (Msdn & Visual Studio)
Whats New In 2010 (Msdn & Visual Studio)
 
Overview of Visual Studio Team System 2010
Overview of Visual Studio Team System 2010Overview of Visual Studio Team System 2010
Overview of Visual Studio Team System 2010
 
Lap Around Visual Studio 2010 Ultimate And TFS 2010
Lap Around Visual Studio 2010 Ultimate And TFS 2010Lap Around Visual Studio 2010 Ultimate And TFS 2010
Lap Around Visual Studio 2010 Ultimate And TFS 2010
 
Visual Studio 2010 RTMtoSP1
Visual Studio 2010 RTMtoSP1Visual Studio 2010 RTMtoSP1
Visual Studio 2010 RTMtoSP1
 
DevOps and Build Automation
DevOps and Build AutomationDevOps and Build Automation
DevOps and Build Automation
 
Community Tour Bologna
Community Tour BolognaCommunity Tour Bologna
Community Tour Bologna
 
Continuous Integration: How I stopped guessing if that merge was bad
Continuous Integration: How I stopped guessing if that merge was badContinuous Integration: How I stopped guessing if that merge was bad
Continuous Integration: How I stopped guessing if that merge was bad
 
Automated Build using teamcity
Automated Build using teamcityAutomated Build using teamcity
Automated Build using teamcity
 
Continuous Everything
Continuous EverythingContinuous Everything
Continuous Everything
 
Vsts 2
Vsts 2Vsts 2
Vsts 2
 
Jeremy thake introducing alm to share point development implementations (ap...
Jeremy thake   introducing alm to share point development implementations (ap...Jeremy thake   introducing alm to share point development implementations (ap...
Jeremy thake introducing alm to share point development implementations (ap...
 
Lab Management with TFS 2010
Lab Management with TFS 2010Lab Management with TFS 2010
Lab Management with TFS 2010
 
Visual Studio 2010 for SharePoint Developers
Visual Studio 2010 for SharePoint DevelopersVisual Studio 2010 for SharePoint Developers
Visual Studio 2010 for SharePoint Developers
 
STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
 
Playing in the SharePoint SandBox
Playing in the SharePoint SandBoxPlaying in the SharePoint SandBox
Playing in the SharePoint SandBox
 

Más de Chris O'Brien

Chris O'Brien - Building AI into Power Platform solutions
Chris O'Brien - Building AI into Power Platform solutionsChris O'Brien - Building AI into Power Platform solutions
Chris O'Brien - Building AI into Power Platform solutionsChris O'Brien
 
Chris OBrien - Azure DevOps for managing work
Chris OBrien - Azure DevOps for managing workChris OBrien - Azure DevOps for managing work
Chris OBrien - Azure DevOps for managing workChris O'Brien
 
Chris O'Brien - Ignite 2019 announcements and selected roadmaps
Chris O'Brien - Ignite 2019 announcements and selected roadmapsChris O'Brien - Ignite 2019 announcements and selected roadmaps
Chris O'Brien - Ignite 2019 announcements and selected roadmapsChris O'Brien
 
COB ESPC18 - Rich PowerApps with offline support
COB ESPC18 - Rich PowerApps with offline supportCOB ESPC18 - Rich PowerApps with offline support
COB ESPC18 - Rich PowerApps with offline supportChris O'Brien
 
COB - Azure Functions for Office 365 developers
COB - Azure Functions for Office 365 developersCOB - Azure Functions for Office 365 developers
COB - Azure Functions for Office 365 developersChris O'Brien
 
COB - PowerApps - the good, the bad and the ugly - early 2018
COB - PowerApps - the good, the bad and the ugly - early 2018COB - PowerApps - the good, the bad and the ugly - early 2018
COB - PowerApps - the good, the bad and the ugly - early 2018Chris O'Brien
 
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)Chris O'Brien
 
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developers
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developersChris O'Brien - Best bits of Azure for Office 365/SharePoint developers
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developersChris O'Brien
 
Chris O'Brien - Intro to Power BI for Office 365 devs (March 2017)
Chris O'Brien - Intro to Power BI for Office 365 devs (March 2017)Chris O'Brien - Intro to Power BI for Office 365 devs (March 2017)
Chris O'Brien - Intro to Power BI for Office 365 devs (March 2017)Chris O'Brien
 
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - referenceChris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - referenceChris O'Brien
 
Chris O'Brien - Introduction to the SharePoint Framework for developers
Chris O'Brien - Introduction to the SharePoint Framework for developersChris O'Brien - Introduction to the SharePoint Framework for developers
Chris O'Brien - Introduction to the SharePoint Framework for developersChris O'Brien
 
Application Lifecycle Management for Office 365 development
Application Lifecycle Management for Office 365 developmentApplication Lifecycle Management for Office 365 development
Application Lifecycle Management for Office 365 developmentChris O'Brien
 
Do's and don'ts for Office 365 development
Do's and don'ts for Office 365 developmentDo's and don'ts for Office 365 development
Do's and don'ts for Office 365 developmentChris O'Brien
 
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 appsChris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 appsChris O'Brien
 
Chris OBrien - Weaving Enterprise Solutions into Office Products
Chris OBrien - Weaving Enterprise Solutions into Office ProductsChris OBrien - Weaving Enterprise Solutions into Office Products
Chris OBrien - Weaving Enterprise Solutions into Office ProductsChris O'Brien
 
Chris O'Brien - Modern SharePoint development: techniques for moving code off...
Chris O'Brien - Modern SharePoint development: techniques for moving code off...Chris O'Brien - Modern SharePoint development: techniques for moving code off...
Chris O'Brien - Modern SharePoint development: techniques for moving code off...Chris O'Brien
 
Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...
Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...
Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...Chris O'Brien
 
Deep dive into SharePoint 2013 hosted apps - Chris OBrien
Deep dive into SharePoint 2013 hosted apps - Chris OBrienDeep dive into SharePoint 2013 hosted apps - Chris OBrien
Deep dive into SharePoint 2013 hosted apps - Chris OBrienChris O'Brien
 
Customizing the SharePoint 2013 user interface with JavaScript - Chris OBrien
Customizing the SharePoint 2013 user interface with JavaScript - Chris OBrienCustomizing the SharePoint 2013 user interface with JavaScript - Chris OBrien
Customizing the SharePoint 2013 user interface with JavaScript - Chris OBrienChris O'Brien
 
SP2013 for Developers - Chris O'Brien
SP2013 for Developers - Chris O'BrienSP2013 for Developers - Chris O'Brien
SP2013 for Developers - Chris O'BrienChris O'Brien
 

Más de Chris O'Brien (20)

Chris O'Brien - Building AI into Power Platform solutions
Chris O'Brien - Building AI into Power Platform solutionsChris O'Brien - Building AI into Power Platform solutions
Chris O'Brien - Building AI into Power Platform solutions
 
Chris OBrien - Azure DevOps for managing work
Chris OBrien - Azure DevOps for managing workChris OBrien - Azure DevOps for managing work
Chris OBrien - Azure DevOps for managing work
 
Chris O'Brien - Ignite 2019 announcements and selected roadmaps
Chris O'Brien - Ignite 2019 announcements and selected roadmapsChris O'Brien - Ignite 2019 announcements and selected roadmaps
Chris O'Brien - Ignite 2019 announcements and selected roadmaps
 
COB ESPC18 - Rich PowerApps with offline support
COB ESPC18 - Rich PowerApps with offline supportCOB ESPC18 - Rich PowerApps with offline support
COB ESPC18 - Rich PowerApps with offline support
 
COB - Azure Functions for Office 365 developers
COB - Azure Functions for Office 365 developersCOB - Azure Functions for Office 365 developers
COB - Azure Functions for Office 365 developers
 
COB - PowerApps - the good, the bad and the ugly - early 2018
COB - PowerApps - the good, the bad and the ugly - early 2018COB - PowerApps - the good, the bad and the ugly - early 2018
COB - PowerApps - the good, the bad and the ugly - early 2018
 
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
 
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developers
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developersChris O'Brien - Best bits of Azure for Office 365/SharePoint developers
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developers
 
Chris O'Brien - Intro to Power BI for Office 365 devs (March 2017)
Chris O'Brien - Intro to Power BI for Office 365 devs (March 2017)Chris O'Brien - Intro to Power BI for Office 365 devs (March 2017)
Chris O'Brien - Intro to Power BI for Office 365 devs (March 2017)
 
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - referenceChris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
 
Chris O'Brien - Introduction to the SharePoint Framework for developers
Chris O'Brien - Introduction to the SharePoint Framework for developersChris O'Brien - Introduction to the SharePoint Framework for developers
Chris O'Brien - Introduction to the SharePoint Framework for developers
 
Application Lifecycle Management for Office 365 development
Application Lifecycle Management for Office 365 developmentApplication Lifecycle Management for Office 365 development
Application Lifecycle Management for Office 365 development
 
Do's and don'ts for Office 365 development
Do's and don'ts for Office 365 developmentDo's and don'ts for Office 365 development
Do's and don'ts for Office 365 development
 
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 appsChris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
 
Chris OBrien - Weaving Enterprise Solutions into Office Products
Chris OBrien - Weaving Enterprise Solutions into Office ProductsChris OBrien - Weaving Enterprise Solutions into Office Products
Chris OBrien - Weaving Enterprise Solutions into Office Products
 
Chris O'Brien - Modern SharePoint development: techniques for moving code off...
Chris O'Brien - Modern SharePoint development: techniques for moving code off...Chris O'Brien - Modern SharePoint development: techniques for moving code off...
Chris O'Brien - Modern SharePoint development: techniques for moving code off...
 
Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...
Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...
Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...
 
Deep dive into SharePoint 2013 hosted apps - Chris OBrien
Deep dive into SharePoint 2013 hosted apps - Chris OBrienDeep dive into SharePoint 2013 hosted apps - Chris OBrien
Deep dive into SharePoint 2013 hosted apps - Chris OBrien
 
Customizing the SharePoint 2013 user interface with JavaScript - Chris OBrien
Customizing the SharePoint 2013 user interface with JavaScript - Chris OBrienCustomizing the SharePoint 2013 user interface with JavaScript - Chris OBrien
Customizing the SharePoint 2013 user interface with JavaScript - Chris OBrien
 
SP2013 for Developers - Chris O'Brien
SP2013 for Developers - Chris O'BrienSP2013 for Developers - Chris O'Brien
SP2013 for Developers - Chris O'Brien
 

Automated Builds And UI Testing in SharePoint 2010 Development

  • 1. Automated builds and UI testing in Sp2010 development Chris O’Brien DEV203
  • 2. About me Independent SharePoint consultant Blog: www.sharepointnutsandbolts.com Twitter: @ChrisO_Brien Book: Real World SharePoint 2010 (20 MVPs) LinkedIn: http://uk.linkedin.com/in/chrisobrienmvp
  • 3. Problems in SP2010 dev projects Many dependencies Code, Features, timer jobs Deployment is complex e.g. No native support for WSP rollback Difficult to unit test Still not much traction in SharePoint world?
  • 4. Problems in *large* SP2010 dev projects Tracking Hard to keep track of deployments/fixes Many developers = many deployments? Inefficiency Devs keeping environment up-to-date Inconsistent builds (or buildmaster bottleneck) Silly mistakes e.g. Incorrect versions Debug vs. Release mode Testing of actual WSPs Communication
  • 5. Solution recipe Auto-compile of assemblies and build of WSPs Correct versions in source control Add a label in source control to help rollback Auto incrementing assembly version number Better tracking of deployments/fixes etc. Deployment of WSPs to remote SharePoint 2010 environment Test environment, not developer machine UI testing Build fails on UI test failure Developer notifications
  • 6. Solution ingredients TFS Team Build workflow (.Net4.0) Specifies sequence of steps PowerShell Deploys WSPs, other deployment steps e.g. teardown/setup site PowerShell remoting(preferred over PsExec) Allows PS on SharePoint box to be called from build server Invoke-Command -ComputerName “foo” { script }
  • 8. Build definition Styles: What’s the trigger? Manual, Scheduled (e.g. nightly), every check-in, Rolling builds, Gated Check-In etc. Customise workflow Mandatory for SharePoint builds Several workflows OOTB DefaultTemplate, LabTemplate
  • 13. What is a coded UI test? Recorded on test agent desktop Support: browser (inc. AJAX), Silverlight, WPF, forms apps Generate code which can be modified (e.g. to pass data) Point and click to add assertions E.g. navigate to web part gallery, check web part present
  • 14. demo Testing SharePoint with coded UI tests
  • 16. Adding COdedui tests to the build
  • 17. Integrating coded UI tests into build Automatic if test assembly name matches filespec Default = “*test*” somewhere in assembly name Background: All tests can be run from command-line with MSTest.exe (Unit tests, Coded UI tests, Load tests, Etc.) Team Build ships with MSTest WF activity (wrapper) The OOTB workflows contain this activity Caveat: OOTB workflows must be edited to deploy WSPs and/or run coded UI tests
  • 18. demo Catching code issues with build/test process
  • 20. Image: test results for build
  • 23. Why stop at UI testing?
  • 24. Image: code profiling in build (1)
  • 25. Image: code profiling in build (2)
  • 27. Best practices Start on day 0 of project Retro-fitting can be expensive Get fast feedback - have a lightweight/quick build run on check-in Compile all projects/build WSPs Suggestion - every SharePoint project should do this much Increment assembly versions (FileVersion) with label generated by build Leverage UI testing (with or without automated builds)
  • 28. Resources Setting up TFS to build SharePoint Projects - http://bit.ly/9lEqnP Assembly versions in build workflow - http://bit.ly/eRPB0e Running tests as part of a build - http://bit.ly/i41eze PS remoting and SharePoint 2010 - http://bit.ly/9Cb4tF Also on my blog soon: My customized workflow and PS scripts Multi-part article series on automated builds/testing www.sharepointnutsandbolts.com
  • 31. What you need - software Automated builds = TFS 2010 (Team Build) Server + 1 CAL free with every MSDN level Need CAL for every user who interacts Components: Build Controller, Build Agent Coded UI tests = Visual Studio 2010 Premium/Ultimate (OR ‘Test Elements’ add-on) Components: Test Controller, Test Agent
  • 32. What you need - hardware Option 1 – the EASY button Disadvantages: Risk to source control Performance SP2010 + TFS2010 = big resource reqs Bottom line: Don’t do this with prod source control!
  • 33. What you need - hardware Option 2 – a sample topology
  • 34. PowerShell remoting To enable: To run: Invoke-Command -ComputerName“foo” { script }