atom-snippets-protractor
Snippets which I find useful whilst writing protractor tests
642 0 0.7.0 ISC GitHub

atom-snippets-protractor

Snippets which I find useful whilst writing page object oriented protractor tests

Jasmine

  • describe('', function() {\n\n});: descblk⇥
  • it('', function() {\n\n});: itblk⇥
  • beforeEach('', function() {\n\n});: beblk⇥
  • afterEach('', function() {\n\n});: aeblk⇥
  • this.thing = function() {\n\n});: thblk⇥

Matchers

  • expect(): expect⇥
  • .to­Be( null | true | false ): tb⇥
  • .toNot­Be( null | true | false ): tnb⇥
  • .toEqual( value ): te⇥
  • .toNotEqual( value ): tne⇥
  • .toMat­ch( regex | string ): tm⇥
  • .toNotMat­ch( regex | string ): tnm⇥
  • .toBe­Def­ine­d(): tbdef­ine­d⇥
  • .toBe­Und­efi­ned(): tbund­efi­ned⇥
  • .toBe­Nul­l(): tbnul­l⇥
  • .toBe­Tru­thy(): tbtru­thy⇥
  • .toBe­Fal­sy(): tbfal­sy⇥
  • .to­Con­tain( string ): tc⇥
  • .toNot­Con­tain( string ): tnc⇥
  • .toBe­Les­sTh­an( number ): tbles­sth­an⇥
  • .toBe­Gre­ate­rTh­an( number ): tbgre­ate­rth­an⇥
  • .toBe­NaN( number ): tbnan⇥
  • .toBe­Clo­seTo( number, precision ): tbclo­seto⇥
  • .toTh­row(): tthrow⇥

WebElement

  • .clear(): clear⇥
  • .click(): click⇥
  • .getAttribute( value ): gatt⇥
  • .getCssValue( stylePropertyName ): gcvalue⇥
  • .getDriver(): gdriver⇥
  • .getInnerHtml(): gih⇥
  • .getLocation(): glocation⇥
  • .getOuterHtml(): goh⇥
  • .getSize(): gsize⇥
  • .getTagName(): gtagname⇥
  • .getText(): gtext⇥
  • .isDisplayed(): isdisplayed⇥
  • .isElementPresent(): iselementpresent⇥
  • .isEnabled(): isenabled⇥
  • .isSelected(): isselected⇥
  • .sendKeys(): skeys⇥
  • .submit(): submit⇥
  • .toWireValue(): twvalue⇥

Locators

  • element by.id: elbi⇥
  • element by.name: elbn⇥
  • element by.className: elbcn⇥
  • element by.deepCss: elbdc⇥
  • element by.linkText: elblt⇥
  • element by.buttonText: elbbt⇥
  • element by.css: elbc⇥
  • element by.model: elbm⇥
  • element by.binding: elbb⇥
  • element by.xpath: elbx⇥
  • element.all by.id: eabi⇥
  • element.all by.name: eabn⇥
  • element.all by.className: eabcn⇥
  • element.all by.deepCss: eabdc⇥
  • element.all by.linkText: eablt⇥
  • element.all by.buttonText: eabbt⇥
  • element.all by.css: eabc⇥
  • element.all by.model: eabm⇥
  • element.all by.binding: eabb⇥
  • element.all by.repeater: eabr⇥
  • element.all by.xpath: eabx⇥

Browser

  • browser.get: brg⇥
  • browser.pause: brp⇥
  • browser.getLocationAbsUrl: brgla⇥
  • browser.setLocation: brsl⇥
  • browser.getCurrentUrl: brgc⇥
  • browser.addMockModule: bram⇥
  • browser.clearMockModules: brcm⇥
  • browser.wait: brw⇥
  • browser.waitForAngular: brwa⇥