Effective Automation Testing Strategies for Web Development Teams

slide1 n.w
1 / 36
Embed
Share

"Explore how to address the misbalance in maturity between developers and QA teams by employing automation testing strategies. Learn about tools like Selenium WebDriver and Protractor, and discover the benefits of writing automation tests based on QA test cases."

  • Automation Testing
  • Selenium WebDriver
  • Protractor
  • Web Development
  • Automation Strategies

Uploaded on | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. We dont need QA anymore or Protractor Yauhen Kavaliou Andrei Palchys

  2. Project Sencha Touch 2 Cordova 5+ products (phone/tablet & ios/android) +3 years and 150k LoC

  3. Team 2 small teams 7 developers 5 manual QA 4 automation testers

  4. Many changes every release There is a misbalance in maturity between Devs and QA Developers produces more code than QA (Manual and Auto) can test in 2 week sprint.

  5. Experiment One dev team will develop and cover features with automation tests Automation tests will be written based on QA tests cases.

  6. Selenium WebDriver

  7. Test WebDriver Browser API

  8. JSON wire protocol POST /session/12345567890/url { "url" : "http://rollingscopes.com/" }

  9. ChromeDriver FirefoxDriver InternetExplorerDriver SafariDriver GhostDriver

  10. Appium

  11. Protractor is an end-to-end test framework for AngularJS JavaScript applications.

  12. describe('rollingscopes.com', function () { it('check meetup name', function () { browser.get('http://rollingscopes.com'); var text = element(by.css('.banner h1')).getText(); expect(text).toEqual('The Rolling Scopes #19'); }); }); Protractor provides nice abstraction on top of WebDriver API and uses Jasmine as a test framework

  13. The WebDriver Control Flow var text = element(by.css('.banner h1')).getText(); expect(text).toEqual('The Rolling Scopes #19'); You write async code in sync way

  14. Google Chrome and ChromeDriver

  15. Jasmine Suits and Specs

  16. describe( 'Suit Name' , function(){ /*specs*/ }) it( 'Spec Name' , function(){ /*expect*/ }, timeout) expect(a).toBe(b) .not.toBe(b) .toBeGreaterThan(b) .toBeLessThan(b) .toEqual(b) .toBeDefined() .toMatch(/\d+/g)

  17. Approaches - Smart automated tests - User as a config

  18. { login: 'user' , password: 'password' , preferences: { hasAccessToFeatures: false, isAdmin: true, hasAnalytics: false }, navigation: [ 'home' , settings' ] }

  19. var specs = { setup: './Base/spec/Setup.js', complete: './Base/spec/Complete.js' }; module.exports = { specs: specs, mandatory: [specs.setup, specs.login], full: [ specs.setup, { name: specs.home, allowed: '*', disabled: ['multipleDeals'] }, specs.settings, specs.complete ] }

  20. Page Object

  21. Before describe( angularjs homepage', function() { it('should greet the named user', function() { browser.get('http://www.angularjs.org'); element(by.model('yourName')).sendKeys('Julie'); var greeting = element(by.binding('yourName')); expect(greeting.getText()).toEqual('Hello Julie!'); }); });

  22. After describe('angularjs homepage', function() { it('should greet the named user', function() { var angularHomepage = new AngularHomepage(); angularHomepage.get(); angularHomepage.setName('Julie'); expect(angularHomepage.getGreeting()) .toEqual('Hello Julie!');

  23. Promises

  24. Base components views util spec Project1 components config spec views Project2 components config spec views

  25. browser.executeScript(string|Function, args) browser.executeScriptAsync(string|Function, args)

  26. Utils - WaitFor method based on ExpectedConditions -Touch interactions and scrolling based on mouseEvents scriptExecute - Specific methods for Sencha Touch, for example - scroll to selected Record and e.t.c.

  27. var EC = protractor.ExpectedConditions; exports.waitFor = function (selector, time) { return browser.wait(EC.presenceOf(element(by.css(selector))), time || 10000); } exports.waitForVisibility = function (selector, time) { return browser.wait(EC.visibilityOf(element(by.css(selector))), time || 10000); } exports.waitForHidden = function (selector, time) { return browser.wait(EC.invisibilityOf(element(by.css(selector))), time || 10000); }}

  28. ... it('App is ready' , function() { //Util.waitFor(this.CSS.container) mainView.waitForLoading(); //browser.isElementPresent(by.css(this.CSS.container)) expect(mainView.isPresent()).toBe(true); }); ... 11:06:19.472 INFO - Executing: [find elements: By.cssSelector: .main-container]) 11:06:19.479 INFO - Done: [find elements: By.cssSelector: .main-container] 11:06:19.484 INFO - Executing: [is enabled: 17 [[ChromeDriver: chrome on XP (fb89e8300a09af71aa37b0b5041c8052)] -> css selector: .main-container]]) 11:06:19.490 INFO - Done: [is enabled: 17 [[ChromeDriver: chrome on XP (fb89e8300a09af71aa37b0b5041c8052)] -> css selector: .main-container]]

  29. xtype support by.xtype = function (xtype) { return { findElementsOverride: function (driver, using, rootSelector) { return driver.findElements( by.xpath( '//div[contains(@id,"' + xtype + '")] | //form[contains(@id,"' + xtype + '")]' ), rootSelector); }, toString: function toString() { return 'by.xtype("' + xtype + '")'; } }; };

  30. Timeouts { allScriptTimeout : timeout } browser.manage().timeouts().implicitlyWait(timeout) jasmineNodeOpts.defaultTimeoutInterval = timeout it ('Spec Name', function(){ /*expect*/ }, timeout)

  31. browser.sleep(timeout)

  32. Plugins - Screenshot reporter - Console - Report

  33. -Different speed of executing on different environments Issues - Tough to debug - Why did my test fail? -WebDriver crashes -DOM manipulations in real-time - Invisible items

  34. Debug Node-inspector

  35. Conclusions

Related


More Related Content