How to use driver.FindElementByAccessibilityId method in Appium

Best JavaScript code snippet using appium

src-tree-yaml.js

Source:src-tree-yaml.js Github

copy

Full Screen

1/**2 * @type {string}3 */4sahagin.srcTreeYamlStr = (function(){/*5rootClassTable:6 classes:7 - methodKeys: [ios.TestFuc.testIOS-void]8 key: ios.TestFuc9 qname: ios.TestFuc10 - methodKeys: [android.TestAndroid.testAndroid-void]11 key: android.TestAndroid12 qname: android.TestAndroid13formatVersion: 0.9.214rootMethodTable:15 methods:16 - name: testIOS17 classKey: ios.TestFuc18 codeBody:19 - endLine: 5120 startLine: 5121 code:22 args:23 - {original: '"http://www.test-arts.cn/isms/"', type: string, value: 'http://www.test-arts.cn/isms/'}24 methodKey: org.openqa.selenium.WebDriver.get25 childInvoke: true26 original: driver.get("http://www.test-arts.cn/isms/");27 type: method28 thisInstance: {original: driver, type: unknown}29 - endLine: 5430 startLine: 5431 code: {original: LoginPage lp=new LoginPage(driver);, type: unknown}32 - endLine: 5533 startLine: 5534 code: {original: HomePage hp=new HomePage(driver);, type: unknown}35 - endLine: 5736 startLine: 5737 code:38 args:39 - {original: '"test"', type: string, value: test}40 methodKey: pages.LoginPage.setUserId-String41 original: lp.setUserId("test");42 type: method43 thisInstance: {name: lp, original: lp, type: localVar}44 - endLine: 5845 startLine: 5846 code:47 args:48 - {original: '"test"', type: string, value: test}49 methodKey: pages.LoginPage.setPassword-String50 original: lp.setPassword("test");51 type: method52 thisInstance: {name: lp, original: lp, type: localVar}53 - endLine: 5954 startLine: 5955 code:56 methodKey: pages.LoginPage.okBtnClick-void57 original: lp.okBtnClick();58 type: method59 thisInstance: {name: lp, original: lp, type: localVar}60 - endLine: 6061 startLine: 6062 code:63 methodKey: pages.HomePage.showHistoryBtnClick-void64 original: hp.showHistoryBtnClick();65 type: method66 thisInstance: {name: hp, original: hp, type: localVar}67 - endLine: 6168 startLine: 6169 code:70 methodKey: pages.HomePage.analysBtnClick-void71 original: hp.analysBtnClick();72 type: method73 thisInstance: {name: hp, original: hp, type: localVar}74 - endLine: 6275 startLine: 6276 code:77 methodKey: pages.HomePage.historyBtnClick-void78 original: hp.historyBtnClick();79 type: method80 thisInstance: {name: hp, original: hp, type: localVar}81 key: ios.TestFuc.testIOS-void82 - name: testAndroid83 classKey: android.TestAndroid84 codeBody:85 - endLine: 4286 startLine: 4287 code:88 args:89 - {original: '"http://www.test-arts.cn/isms/"', type: string, value: 'http://www.test-arts.cn/isms/'}90 methodKey: org.openqa.selenium.WebDriver.get91 childInvoke: true92 original: driver.get("http://www.test-arts.cn/isms/");93 type: method94 thisInstance: {original: driver, type: unknown}95 - endLine: 4396 startLine: 4397 code: {original: LoginPage lp=new LoginPage(driver);, type: unknown}98 - endLine: 4499 startLine: 44100 code: {original: HomePage hp=new HomePage(driver);, type: unknown}101 - endLine: 45102 startLine: 45103 code:104 args:105 - {original: '"test"', type: string, value: test}106 methodKey: pages.LoginPage.setUserId-String107 original: lp.setUserId("test");108 type: method109 thisInstance: {name: lp, original: lp, type: localVar}110 - endLine: 46111 startLine: 46112 code:113 args:114 - {original: '"test"', type: string, value: test}115 methodKey: pages.LoginPage.setPassword-String116 original: lp.setPassword("test");117 type: method118 thisInstance: {name: lp, original: lp, type: localVar}119 - endLine: 47120 startLine: 47121 code:122 methodKey: pages.LoginPage.okBtnClick-void123 original: lp.okBtnClick();124 type: method125 thisInstance: {name: lp, original: lp, type: localVar}126 - endLine: 48127 startLine: 48128 code:129 methodKey: pages.HomePage.showHistoryBtnClick-void130 original: hp.showHistoryBtnClick();131 type: method132 thisInstance: {name: hp, original: hp, type: localVar}133 - endLine: 49134 startLine: 49135 code:136 methodKey: pages.HomePage.analysBtnClick-void137 original: hp.analysBtnClick();138 type: method139 thisInstance: {name: hp, original: hp, type: localVar}140 - endLine: 50141 startLine: 50142 code:143 methodKey: pages.HomePage.historyBtnClick-void144 original: hp.historyBtnClick();145 type: method146 thisInstance: {name: hp, original: hp, type: localVar}147 key: android.TestAndroid.testAndroid-void148subMethodTable:149 methods:150 - name: studyBtnClick151 testDoc: click study button152 classKey: pages.HomePage153 codeBody:154 - endLine: 19155 startLine: 19156 code:157 methodKey: org.openqa.selenium.WebElement.click158 original: driver.findElementById("studyBtn_00").click();159 type: method160 thisInstance:161 args:162 - {original: '"studyBtn_00"', type: string, value: studyBtn_00}163 methodKey: org.openqa.selenium.remote.RemoteWebDriver.findElementById164 childInvoke: true165 original: driver.findElementById("studyBtn_00")166 type: method167 thisInstance: {original: driver, type: unknown}168 - endLine: 20169 startLine: 20170 code: {original: Thread.sleep(2000);, type: unknown}171 key: pages.HomePage.studyBtnClick-void172 - name: showHistoryBtnClick173 testDoc: click showHistory button174 classKey: pages.HomePage175 codeBody:176 - endLine: 25177 startLine: 25178 code:179 methodKey: org.openqa.selenium.WebElement.click180 original: driver.findElementById("showHistoryBtn").click();181 type: method182 thisInstance:183 args:184 - {original: '"showHistoryBtn"', type: string, value: showHistoryBtn}185 methodKey: org.openqa.selenium.remote.RemoteWebDriver.findElementById186 childInvoke: true187 original: driver.findElementById("showHistoryBtn")188 type: method189 thisInstance: {original: driver, type: unknown}190 - endLine: 26191 startLine: 26192 code: {original: Thread.sleep(2000);, type: unknown}193 key: pages.HomePage.showHistoryBtnClick-void194 - name: analysBtnClick195 testDoc: click analys button196 classKey: pages.HomePage197 codeBody:198 - endLine: 31199 startLine: 31200 code:201 methodKey: org.openqa.selenium.WebElement.click202 original: driver.findElementById("analysBtn0").click();203 type: method204 thisInstance:205 args:206 - {original: '"analysBtn0"', type: string, value: analysBtn0}207 methodKey: org.openqa.selenium.remote.RemoteWebDriver.findElementById208 childInvoke: true209 original: driver.findElementById("analysBtn0")210 type: method211 thisInstance: {original: driver, type: unknown}212 - endLine: 32213 startLine: 32214 code: {original: Thread.sleep(2000);, type: unknown}215 key: pages.HomePage.analysBtnClick-void216 - name: historyBtnClick217 testDoc: click history button218 classKey: pages.HomePage219 codeBody:220 - endLine: 37221 startLine: 37222 code:223 methodKey: org.openqa.selenium.WebElement.click224 original: driver.findElementById("historyBtn0").click();225 type: method226 thisInstance:227 args:228 - {original: '"historyBtn0"', type: string, value: historyBtn0}229 methodKey: org.openqa.selenium.remote.RemoteWebDriver.findElementById230 childInvoke: true231 original: driver.findElementById("historyBtn0")232 type: method233 thisInstance: {original: driver, type: unknown}234 - endLine: 38235 startLine: 38236 code: {original: Thread.sleep(2000);, type: unknown}237 key: pages.HomePage.historyBtnClick-void238 - name: dataBtnClick239 testDoc: 情報セキュリティ 2016年度版240 classKey: pages.DataSecurity241 codeBody:242 - endLine: 22243 startLine: 22244 code:245 methodKey: org.openqa.selenium.WebElement.click246 original: driver.findElementByLinkText("情報セキュリティ 2016年度版").click();247 type: method248 thisInstance:249 args:250 - {original: '"情報セキュリティ 2016年度版"', type: string, value: 情報セキュリティ 2016年度版}251 methodKey: org.openqa.selenium.remote.RemoteWebDriver.findElementByLinkText252 childInvoke: true253 original: driver.findElementByLinkText("情報セキュリティ 2016年度版")254 type: method255 thisInstance: {original: driver, type: unknown}256 - endLine: 23257 startLine: 23258 code: {original: Thread.sleep(5000);, type: unknown}259 key: pages.DataSecurity.dataBtnClick-void260 - name: iosNextBtnClick261 testDoc: 次へios262 classKey: pages.DataSecurity263 codeBody:264 - endLine: 30265 startLine: 30266 code:267 original: List<WebElement> list=driver.findElementsByClassName("XCUIElementTypeButton");268 type: varAssign269 value:270 args:271 - {original: '"XCUIElementTypeButton"', type: string, value: XCUIElementTypeButton}272 methodKey: org.openqa.selenium.remote.RemoteWebDriver.findElementsByClassName273 childInvoke: true274 original: driver.findElementsByClassName("XCUIElementTypeButton")275 type: method276 thisInstance: {original: driver, type: unknown}277 var: {name: list, original: list, type: localVar}278 - endLine: 31279 startLine: 31280 code: {original: System.out.println(list.size());, type: unknown}281 - endLine: 32282 startLine: 32283 code:284 methodKey: org.openqa.selenium.WebElement.click285 original: list.get(0).click();286 type: method287 thisInstance:288 args:289 - {original: '0', type: unknown}290 methodKey: java.util.List.get291 original: list.get(0)292 type: method293 thisInstance: {name: list, original: list, type: localVar}294 key: pages.DataSecurity.iosNextBtnClick-void295 - name: androidNextBtnClick296 testDoc: 次へandroid297 classKey: pages.DataSecurity298 codeBody:299 - endLine: 40300 startLine: 40301 code:302 methodKey: org.openqa.selenium.WebElement.click303 original: driver.findElementByXPath("//android.widget.FrameLayout[@resource-id='com.android.chrome:id/compositor_view_holder']/android.widget.FrameLayout[2]/android.webkit.WebView/android.view.View/android.view.View/android.view.View[2]/android.view.View[2]/android.widget.Button[2]").click();304 type: method305 thisInstance:306 args:307 - {original: '"//android.widget.FrameLayout[@resource-id=''com.android.chrome:id/compositor_view_holder'']/android.widget.FrameLayout[2]/android.webkit.WebView/android.view.View/android.view.View/android.view.View[2]/android.view.View[2]/android.widget.Button[2]"',308 type: string, value: '//android.widget.FrameLayout[@resource-id=''com.android.chrome:id/compositor_view_holder'']/android.widget.FrameLayout[2]/android.webkit.WebView/android.view.View/android.view.View/android.view.View[2]/android.view.View[2]/android.widget.Button[2]'}309 methodKey: org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath310 childInvoke: true311 original: driver.findElementByXPath("//android.widget.FrameLayout[@resource-id='com.android.chrome:id/compositor_view_holder']/android.widget.FrameLayout[2]/android.webkit.WebView/android.view.View/android.view.View/android.view.View[2]/android.view.View[2]/android.widget.Button[2]")312 type: method313 thisInstance: {original: driver, type: unknown}314 key: pages.DataSecurity.androidNextBtnClick-void315 - name: setUserId316 testDoc: set ID317 classKey: pages.LoginPage318 argVariables: [value]319 codeBody:320 - endLine: 20321 startLine: 20322 code:323 args:324 - {original: value, type: arg, argIndex: 0}325 methodKey: org.openqa.selenium.WebElement.sendKeys326 original: driver.findElementById("j_username").sendKeys(value);327 type: method328 thisInstance:329 args:330 - {original: '"j_username"', type: string, value: j_username}331 methodKey: org.openqa.selenium.remote.RemoteWebDriver.findElementById332 childInvoke: true333 original: driver.findElementById("j_username")334 type: method335 thisInstance: {original: driver, type: unknown}336 key: pages.LoginPage.setUserId-String337 - name: setPassword338 testDoc: set PSW339 classKey: pages.LoginPage340 argVariables: [value]341 codeBody:342 - endLine: 25343 startLine: 25344 code:345 args:346 - {original: value, type: arg, argIndex: 0}347 methodKey: org.openqa.selenium.WebElement.sendKeys348 original: driver.findElementById("j_password").sendKeys(value);349 type: method350 thisInstance:351 args:352 - {original: '"j_password"', type: string, value: j_password}353 methodKey: org.openqa.selenium.remote.RemoteWebDriver.findElementById354 childInvoke: true355 original: driver.findElementById("j_password")356 type: method357 thisInstance: {original: driver, type: unknown}358 key: pages.LoginPage.setPassword-String359 - name: okBtnClick360 testDoc: click ok button361 classKey: pages.LoginPage362 codeBody:363 - endLine: 30364 startLine: 30365 code:366 methodKey: org.openqa.selenium.WebElement.click367 original: driver.findElementById("loginBtn").click();368 type: method369 thisInstance:370 args:371 - {original: '"loginBtn"', type: string, value: loginBtn}372 methodKey: org.openqa.selenium.remote.RemoteWebDriver.findElementById373 childInvoke: true374 original: driver.findElementById("loginBtn")375 type: method376 thisInstance: {original: driver, type: unknown}377 - endLine: 31378 startLine: 31379 code: {original: Thread.sleep(2000);, type: unknown}380 key: pages.LoginPage.okBtnClick-void381 - {name: assert, testDoc: 'check that {0}', capture: none, classKey: javaSystem,382 key: javaSystem.assert}383 - {name: equals, testDoc: '''{0}'' equals to ''{1}''', capture: none, classKey: javaSystem,384 key: javaSystem.equals}385 - {name: notEquals, testDoc: '''{0}'' does not equal to ''{1}''', capture: none,386 classKey: javaSystem, key: javaSystem.notEquals}387 - {name: assertEquals, testDoc: '', classKey: junit.framework.Assert, key: 'junit.framework.Assert.assertEquals-double,double'}388 - {name: assertEquals, testDoc: '', classKey: junit.framework.Assert, key: 'junit.framework.Assert.assertEquals-long,long'}389 - {name: assertEquals, testDoc: '', classKey: junit.framework.Assert, key: 'junit.framework.Assert.assertEquals-Object,Object'}390 - {name: assertEquals, testDoc: '', classKey: junit.framework.Assert, key: 'junit.framework.Assert.assertEquals-Object[],Object[]'}391 - {name: is, testDoc: 'equals to ''{0}''', capture: none, classKey: org.hamcrest.core.Is,392 key: org.hamcrest.core.Is.is-Object}393 - {name: is, testDoc: '{0}', capture: none, classKey: org.hamcrest.core.Is, key: org.hamcrest.core.Is.is-org.hamcrest.Matcher}394 - {name: not, testDoc: 'does not equal to ''{0}''', capture: none, classKey: org.hamcrest.core.IsNot,395 key: org.hamcrest.core.IsNot.not-Object}396 - {name: not, testDoc: 'does not equal to ''{0}''', capture: none, classKey: org.hamcrest.core.IsNot,397 key: org.hamcrest.core.IsNot.not-org.hamcrest.Matcher}398 - {name: is, testDoc: 'equals to ''{0}''', capture: none, classKey: org.hamcrest.CoreMatchers,399 key: org.hamcrest.CoreMatchers.is-Object}400 - {name: is, testDoc: '{0}', capture: none, classKey: org.hamcrest.CoreMatchers,401 key: org.hamcrest.CoreMatchers.is-org.hamcrest.Matcher}402 - {name: not, testDoc: 'does not equal to ''{0}''', capture: none, classKey: org.hamcrest.CoreMatchers,403 key: org.hamcrest.CoreMatchers.not-Object}404 - {name: not, testDoc: 'does not equal to ''{0}''', capture: none, classKey: org.hamcrest.CoreMatchers,405 key: org.hamcrest.CoreMatchers.not-org.hamcrest.Matcher}406 - {name: assertEquals, testDoc: 'check that ''{0}'' equals to ''{1}''', classKey: org.junit.Assert,407 key: 'org.junit.Assert.assertEquals-double,double'}408 - {name: assertEquals, testDoc: 'check that ''{0}'' equals to ''{1}''', classKey: org.junit.Assert,409 key: 'org.junit.Assert.assertEquals-long,long'}410 - {name: assertEquals, testDoc: 'check that ''{0}'' equals to ''{1}''', classKey: org.junit.Assert,411 key: 'org.junit.Assert.assertEquals-Object,Object'}412 - {name: assertEquals, testDoc: 'check that ''{0}'' equals to ''{1}''', classKey: org.junit.Assert,413 key: 'org.junit.Assert.assertEquals-Object[],Object[]'}414 - {name: assertThat, testDoc: 'check that ''{0}'' {1}', classKey: org.junit.Assert,415 key: 'org.junit.Assert.assertThat-Object,org.hamcrest.Matcher'}416 - {name: assertThat, testDoc: 'check that ''{1}'' {2}', classKey: org.junit.Assert,417 key: 'org.junit.Assert.assertThat-String,Object,org.hamcrest.Matcher'}418 - {name: assertThat, testDoc: 'check that ''{0}'' {1}', classKey: org.hamcrest.MatcherAssert,419 key: 'org.hamcrest.MatcherAssert.assertThat-Object,org.hamcrest.Matcher'}420 - {name: assertThat, testDoc: 'check that ''{1}'' {2}', classKey: org.hamcrest.MatcherAssert,421 key: 'org.hamcrest.MatcherAssert.assertThat-String,Object,org.hamcrest.Matcher'}422 - {name: assertEquals, testDoc: 'check that ''{0}'' equals to ''{1}''', classKey: org.testng.Assert,423 key: 'org.testng.Assert.assertEquals-boolean,boolean'}424 - {name: assertEquals, testDoc: 'check that ''{0}'' equals to ''{1}''', classKey: org.testng.Assert,425 key: 'org.testng.Assert.assertEquals-int,int'}426 - {name: assertEquals, testDoc: 'check that ''{0}'' equals to ''{1}''', classKey: org.testng.Assert,427 key: 'org.testng.Assert.assertEquals-long,long'}428 - {name: assertEquals, testDoc: 'check that ''{0}'' equals to ''{1}''', classKey: org.testng.Assert,429 key: 'org.testng.Assert.assertEquals-Object,Object'}430 - {name: assertEquals, testDoc: 'check that ''{0}'' equals to ''{1}''', classKey: org.testng.Assert,431 key: 'org.testng.Assert.assertEquals-Object[],Object[]'}432 - {name: assertEquals, testDoc: 'check that ''{0}'' equals to ''{1}''', classKey: org.testng.Assert,433 key: 'org.testng.Assert.assertEquals-String,String'}434 - {name: get, testDoc: '''{0}''th element of ''{this}''', capture: none, classKey: java.util.List,435 key: java.util.List.get}436 - {name: className, testDoc: 'class name = {0}', capture: none, classKey: org.openqa.selenium.By,437 key: org.openqa.selenium.By.className}438 - {name: cssSelector, testDoc: 'css = {0}', capture: none, classKey: org.openqa.selenium.By,439 key: org.openqa.selenium.By.cssSelector}440 - {name: id, testDoc: 'id = {0}', capture: none, classKey: org.openqa.selenium.By,441 key: org.openqa.selenium.By.id}442 - {name: linkText, testDoc: 'text = {0}', capture: none, classKey: org.openqa.selenium.By,443 key: org.openqa.selenium.By.linkText}444 - {name: name, testDoc: 'name = {0}', capture: none, classKey: org.openqa.selenium.By,445 key: org.openqa.selenium.By.name}446 - {name: partialLinkText, testDoc: 'text = {0}(partial match)', capture: none, classKey: org.openqa.selenium.By,447 key: org.openqa.selenium.By.partialLinkText}448 - {name: tagName, testDoc: 'tag name = {0}', capture: none, classKey: org.openqa.selenium.By,449 key: org.openqa.selenium.By.tagName}450 - {name: xpath, testDoc: 'xpath = {0}', capture: none, classKey: org.openqa.selenium.By,451 key: org.openqa.selenium.By.xpath}452 - {name: findElementByClassName, testDoc: 'element ''class name = {0}''', classKey: org.openqa.selenium.remote.RemoteWebDriver,453 key: org.openqa.selenium.remote.RemoteWebDriver.findElementByClassName}454 - {name: findElementByCssSelector, testDoc: 'element ''css = {0}''', classKey: org.openqa.selenium.remote.RemoteWebDriver,455 key: org.openqa.selenium.remote.RemoteWebDriver.findElementByCssSelector}456 - {name: findElementById, testDoc: 'element ''id = {0}''', classKey: org.openqa.selenium.remote.RemoteWebDriver,457 key: org.openqa.selenium.remote.RemoteWebDriver.findElementById}458 - {name: findElementByLinkText, testDoc: 'element ''text = {0}''', classKey: org.openqa.selenium.remote.RemoteWebDriver,459 key: org.openqa.selenium.remote.RemoteWebDriver.findElementByLinkText}460 - {name: findElementByName, testDoc: 'element ''name = {0}''', classKey: org.openqa.selenium.remote.RemoteWebDriver,461 key: org.openqa.selenium.remote.RemoteWebDriver.findElementByName}462 - {name: findElementByPartialLinkText, testDoc: 'element ''text = {0}(partial match)''',463 classKey: org.openqa.selenium.remote.RemoteWebDriver, key: org.openqa.selenium.remote.RemoteWebDriver.findElementByPartialLinkText}464 - {name: findElementByTagName, testDoc: 'element ''tag name = {0}''', classKey: org.openqa.selenium.remote.RemoteWebDriver,465 key: org.openqa.selenium.remote.RemoteWebDriver.findElementByTagName}466 - {name: findElementByXPath, testDoc: 'element ''xpath = {0}''', classKey: org.openqa.selenium.remote.RemoteWebDriver,467 key: org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath}468 - {name: findElementsByClassName, testDoc: 'all elements for ''class name = {0}''',469 classKey: org.openqa.selenium.remote.RemoteWebDriver, key: org.openqa.selenium.remote.RemoteWebDriver.findElementsByClassName}470 - {name: findElementsByCssSelector, testDoc: 'all elements for ''css = {0}''', classKey: org.openqa.selenium.remote.RemoteWebDriver,471 key: org.openqa.selenium.remote.RemoteWebDriver.findElementsByCssSelector}472 - {name: findElementsById, testDoc: 'all elements for ''id = {0}''', classKey: org.openqa.selenium.remote.RemoteWebDriver,473 key: org.openqa.selenium.remote.RemoteWebDriver.findElementsById}474 - {name: findElementsByLinkText, testDoc: 'all elements for ''text = {0}''', classKey: org.openqa.selenium.remote.RemoteWebDriver,475 key: org.openqa.selenium.remote.RemoteWebDriver.findElementsByLinkText}476 - {name: findElementsByName, testDoc: 'all elements for ''name = {0}''', classKey: org.openqa.selenium.remote.RemoteWebDriver,477 key: org.openqa.selenium.remote.RemoteWebDriver.findElementsByName}478 - {name: findElementsByPartialLinkText, testDoc: 'all elements for ''text = {0}(partial479 match)''', classKey: org.openqa.selenium.remote.RemoteWebDriver, key: org.openqa.selenium.remote.RemoteWebDriver.findElementsByPartialLinkText}480 - {name: findElementsByTagName, testDoc: 'all elements for ''tag name = {0}''',481 classKey: org.openqa.selenium.remote.RemoteWebDriver, key: org.openqa.selenium.remote.RemoteWebDriver.findElementsByTagName}482 - {name: findElementsByXPath, testDoc: 'all elements for ''xpath = {0}''', classKey: org.openqa.selenium.remote.RemoteWebDriver,483 key: org.openqa.selenium.remote.RemoteWebDriver.findElementsByXPath}484 - {name: getOrientation, testDoc: the screen orientation, classKey: org.openqa.selenium.Rotatable,485 key: org.openqa.selenium.Rotatable.getOrientation}486 - {name: rotate, testDoc: 'rotate the screen to {0}', classKey: org.openqa.selenium.Rotatable,487 key: org.openqa.selenium.Rotatable.rotate}488 - {name: Select, testDoc: 'pull-down for {0}', classKey: org.openqa.selenium.support.ui.Select,489 key: org.openqa.selenium.support.ui.Select.Select}490 - {name: selectByIndex, testDoc: 'select ''{0}''th item of {this}', classKey: org.openqa.selenium.support.ui.Select,491 key: org.openqa.selenium.support.ui.Select.selectByIndex}492 - {name: selectByValue, testDoc: 'select ''value = {0}'' item of {this}', classKey: org.openqa.selenium.support.ui.Select,493 key: org.openqa.selenium.support.ui.Select.selectByValue}494 - {name: selectByVisibleText, testDoc: 'select ''text = {0}'' item of {this}', classKey: org.openqa.selenium.support.ui.Select,495 key: org.openqa.selenium.support.ui.Select.selectByVisibleText}496 - {name: close, testDoc: close the current window, classKey: org.openqa.selenium.WebDriver,497 key: org.openqa.selenium.WebDriver.close}498 - {name: findElement, testDoc: 'element ''{0}''', classKey: org.openqa.selenium.WebDriver,499 key: org.openqa.selenium.WebDriver.findElement}500 - {name: findElements, testDoc: 'all elements for ''{0}''', classKey: org.openqa.selenium.WebDriver,501 key: org.openqa.selenium.WebDriver.findElements}502 - {name: get, testDoc: 'go to the page ''{0}''', classKey: org.openqa.selenium.WebDriver,503 key: org.openqa.selenium.WebDriver.get}504 - {name: getCurrentUrl, testDoc: the current URL, classKey: org.openqa.selenium.WebDriver,505 key: org.openqa.selenium.WebDriver.getCurrentUrl}506 - {name: getTitle, testDoc: the page title, classKey: org.openqa.selenium.WebDriver,507 key: org.openqa.selenium.WebDriver.getTitle}508 - {name: quit, testDoc: terminate the browser, classKey: org.openqa.selenium.WebDriver,509 key: org.openqa.selenium.WebDriver.quit}510 - {name: back, testDoc: go back to the previous page, classKey: org.openqa.selenium.WebDriver$Navigation,511 key: org.openqa.selenium.WebDriver$Navigation.back}512 - {name: forward, testDoc: go forward to the next page, classKey: org.openqa.selenium.WebDriver$Navigation,513 key: org.openqa.selenium.WebDriver$Navigation.forward}514 - {name: refresh, testDoc: reload the page, classKey: org.openqa.selenium.WebDriver$Navigation,515 key: org.openqa.selenium.WebDriver$Navigation.refresh}516 - {name: to, testDoc: 'go to the page ''{0}''', classKey: org.openqa.selenium.WebDriver$Navigation,517 key: org.openqa.selenium.WebDriver$Navigation.to}518 - {name: clear, testDoc: 'clear the text of {this}', classKey: org.openqa.selenium.WebElement,519 key: org.openqa.selenium.WebElement.clear}520 - {name: click, testDoc: 'click {this}', classKey: org.openqa.selenium.WebElement,521 key: org.openqa.selenium.WebElement.click}522 - {name: getAttribute, testDoc: 'the ''{0}'' attribute of {this}', classKey: org.openqa.selenium.WebElement,523 key: org.openqa.selenium.WebElement.getAttribute}524 - {name: getText, testDoc: 'the text of {this}', classKey: org.openqa.selenium.WebElement,525 key: org.openqa.selenium.WebElement.getText}526 - {name: isDisplayed, testDoc: 'is {this} displayed', classKey: org.openqa.selenium.WebElement,527 key: org.openqa.selenium.WebElement.isDisplayed}528 - {name: isEnabled, testDoc: 'is {this} enabled', classKey: org.openqa.selenium.WebElement,529 key: org.openqa.selenium.WebElement.isEnabled}530 - {name: isSelected, testDoc: 'is {this} selected', classKey: org.openqa.selenium.WebElement,531 key: org.openqa.selenium.WebElement.isSelected}532 - {name: sendKeys, testDoc: 'send keys ''{0}'' to {this}', classKey: org.openqa.selenium.WebElement,533 key: org.openqa.selenium.WebElement.sendKeys}534 - {name: submit, testDoc: submit the form data, classKey: org.openqa.selenium.WebElement,535 key: org.openqa.selenium.WebElement.submit}536 - {name: findElementByAndroidUIAutomator, testDoc: 'element ''Android UiAutomator537 = {0}''', classKey: io.appium.java_client.android.AndroidDriver, key: io.appium.java_client.android.AndroidDriver.findElementByAndroidUIAutomator}538 - {name: findElementsByAndroidUIAutomator, testDoc: 'all elements for ''Android539 UiAutomator = {0}''', classKey: io.appium.java_client.android.AndroidDriver,540 key: io.appium.java_client.android.AndroidDriver.findElementsByAndroidUIAutomator}541 - {name: isLocked, testDoc: is the screen locked, classKey: io.appium.java_client.android.AndroidDriver,542 key: io.appium.java_client.android.AndroidDriver.isLocked}543 - {name: findElementByAccessibilityId, testDoc: 'element ''accessibility ID = {0}''',544 classKey: io.appium.java_client.AppiumDriver, key: io.appium.java_client.AppiumDriver.findElementByAccessibilityId}545 - {name: findElementsByAccessibilityId, testDoc: 'all elements for ''accessibility546 ID = {0}''', classKey: io.appium.java_client.AppiumDriver, key: io.appium.java_client.AppiumDriver.findElementsByAccessibilityId}547 - {name: hideKeyboard, testDoc: hide the keyboard, classKey: io.appium.java_client.AppiumDriver,548 key: io.appium.java_client.AppiumDriver.hideKeyboard}549 - {name: lockScreen, testDoc: 'lock the screen for {0} seconds', classKey: io.appium.java_client.AppiumDriver,550 key: io.appium.java_client.AppiumDriver.lockScreen}551 - {name: pinch, testDoc: 'zoom out (x:{0}, y:{1}) by pinch-in', classKey: io.appium.java_client.AppiumDriver,552 key: 'io.appium.java_client.AppiumDriver.pinch-int,int'}553 - {name: pinch, testDoc: 'zoom out {0} by pinch-in', classKey: io.appium.java_client.AppiumDriver,554 key: io.appium.java_client.AppiumDriver.pinch-org.openqa.selenium.WebElement}555 - {name: swipe, testDoc: 'swipe from (x:{0}, y:{1}) to (x:{2}, y:{3}) in {4} milliseconds',556 classKey: io.appium.java_client.AppiumDriver, key: io.appium.java_client.AppiumDriver.swipe}557 - {name: tap, testDoc: 'tap (x:{1}, y:{2}) with {0} fingers for {3} milliseconds',558 classKey: io.appium.java_client.AppiumDriver, key: 'io.appium.java_client.AppiumDriver.tap-int,int,int,int'}559 - {name: tap, testDoc: 'tap {1} with {0} fingers for {2} milliseconds', classKey: io.appium.java_client.AppiumDriver,560 key: 'io.appium.java_client.AppiumDriver.tap-int,org.openqa.selenium.WebElement,int'}561 - {name: zoom, testDoc: 'zoom in (x:{0}, y:{1}) by pinch-out', classKey: io.appium.java_client.AppiumDriver,562 key: 'io.appium.java_client.AppiumDriver.zoom-int,int'}563 - {name: zoom, testDoc: 'zoom in {0} by pinch-out', classKey: io.appium.java_client.AppiumDriver,564 key: io.appium.java_client.AppiumDriver.zoom-org.openqa.selenium.WebElement}565 - {name: findElementByIosUIAutomation, testDoc: 'element ''iOS UIAutomation = {0}''',566 classKey: io.appium.java_client.ios.IOSDriver, key: io.appium.java_client.ios.IOSDriver.findElementByIosUIAutomation}567 - {name: findElementsByIosUIAutomation, testDoc: 'all elements for ''iOS UIAutomation568 = {0}''', classKey: io.appium.java_client.ios.IOSDriver, key: io.appium.java_client.ios.IOSDriver.findElementsByIosUIAutomation}569 - {name: shake, testDoc: shake the device, classKey: io.appium.java_client.ios.IOSDriver,570 key: io.appium.java_client.ios.IOSDriver.shake}571 - {name: AccessibilityId, testDoc: 'accessibility ID = {0}', capture: none, classKey: io.appium.java_client.MobileBy,572 key: io.appium.java_client.MobileBy.AccessibilityId}573 - {name: AndroidUIAutomator, testDoc: 'Android UiAutomator = {0}', capture: none,574 classKey: io.appium.java_client.MobileBy, key: io.appium.java_client.MobileBy.AndroidUIAutomator}575 - {name: IosUIAutomation, testDoc: 'iOS UIAutomation = {0}', capture: none, classKey: io.appium.java_client.MobileBy,576 key: io.appium.java_client.MobileBy.IosUIAutomation}577 - {name: with, testDoc: 'set text ''{0}'' to {this}', classKey: org.fluentlenium.core.action.FillConstructor,578 key: org.fluentlenium.core.action.FillConstructor.with}579 - {name: clear, testDoc: 'clear the text of {this}', classKey: org.fluentlenium.core.domain.FluentList,580 key: org.fluentlenium.core.domain.FluentList.clear}581 - {name: click, testDoc: 'click {this}', classKey: org.fluentlenium.core.domain.FluentList,582 key: org.fluentlenium.core.domain.FluentList.click}583 - {name: getAttribute, testDoc: 'the ''{0}'' attribute of {this}', classKey: org.fluentlenium.core.domain.FluentList,584 key: org.fluentlenium.core.domain.FluentList.getAttribute}585 - {name: getText, testDoc: 'the text of {this}', classKey: org.fluentlenium.core.domain.FluentList,586 key: org.fluentlenium.core.domain.FluentList.getText}587 - {name: getValue, testDoc: 'the value of {this}', classKey: org.fluentlenium.core.domain.FluentList,588 key: org.fluentlenium.core.domain.FluentList.getValue}589 - {name: clear, testDoc: 'clear the text of {this}', classKey: org.fluentlenium.core.domain.FluentWebElement,590 key: org.fluentlenium.core.domain.FluentWebElement.clear}591 - {name: click, testDoc: 'click {this}', classKey: org.fluentlenium.core.domain.FluentWebElement,592 key: org.fluentlenium.core.domain.FluentWebElement.click}593 - {name: getAttribute, testDoc: 'the ''{0}'' attribute of {this}', classKey: org.fluentlenium.core.domain.FluentWebElement,594 key: org.fluentlenium.core.domain.FluentWebElement.getAttribute}595 - {name: getText, testDoc: 'the text of {this}', classKey: org.fluentlenium.core.domain.FluentWebElement,596 key: org.fluentlenium.core.domain.FluentWebElement.getText}597 - {name: getValue, testDoc: 'the value of {this}', classKey: org.fluentlenium.core.domain.FluentWebElement,598 key: org.fluentlenium.core.domain.FluentWebElement.getValue}599 - {name: isDisplayed, testDoc: 'is {this} displayed', classKey: org.fluentlenium.core.domain.FluentWebElement,600 key: org.fluentlenium.core.domain.FluentWebElement.isDisplayed}601 - {name: isEnabled, testDoc: 'is {this} enabled', classKey: org.fluentlenium.core.domain.FluentWebElement,602 key: org.fluentlenium.core.domain.FluentWebElement.isEnabled}603 - {name: isSelected, testDoc: 'is {this} selected', classKey: org.fluentlenium.core.domain.FluentWebElement,604 key: org.fluentlenium.core.domain.FluentWebElement.isSelected}605 - {name: withClass, testDoc: 'class = {0}', capture: none, classKey: org.fluentlenium.core.filter.FilterConstructor,606 key: org.fluentlenium.core.filter.FilterConstructor.withClass-String}607 - {name: withName, testDoc: 'name = {0}', capture: none, classKey: org.fluentlenium.core.filter.FilterConstructor,608 key: org.fluentlenium.core.filter.FilterConstructor.withName-String}609 - {name: withText, testDoc: 'text = {0}', capture: none, classKey: org.fluentlenium.core.filter.FilterConstructor,610 key: org.fluentlenium.core.filter.FilterConstructor.withText-String}611 - {name: $, testDoc: 'element ''{0}{if:1} ({1}){end}''', classKey: org.fluentlenium.core.Fluent,612 varLengthArgIndex: 1, key: 'org.fluentlenium.core.Fluent.$-String,org.fluentlenium.core.filter.Filter[]'}613 - {name: $, testDoc: '''{1}''th element of ''{0}{if:2} ({2}){end}''', classKey: org.fluentlenium.core.Fluent,614 varLengthArgIndex: 2, key: 'org.fluentlenium.core.Fluent.$-String,java.lang.Integer,org.fluentlenium.core.filter.Filter[]'}615 - {name: clear, testDoc: 'clear the text of element ''{0}{if:1} ({1}){end}''', classKey: org.fluentlenium.core.Fluent,616 varLengthArgIndex: 1, key: org.fluentlenium.core.Fluent.clear}617 - {name: click, testDoc: 'click element ''{0}{if:1} ({1}){end}''', classKey: org.fluentlenium.core.Fluent,618 varLengthArgIndex: 1, key: org.fluentlenium.core.Fluent.click}619 - {name: executeScript, testDoc: 'execute JavaScript ''{0}''', classKey: org.fluentlenium.core.Fluent,620 varLengthArgIndex: 1, key: org.fluentlenium.core.Fluent.executeScript}621 - {name: fill, testDoc: 'element ''{0}{if:1} ({1}){end}''', classKey: org.fluentlenium.core.Fluent,622 varLengthArgIndex: 1, key: org.fluentlenium.core.Fluent.fill}623 - {name: find, testDoc: 'element ''{0}{if:1} ({1}){end}''', classKey: org.fluentlenium.core.Fluent,624 varLengthArgIndex: 1, key: 'org.fluentlenium.core.Fluent.find-String,org.fluentlenium.core.filter.Filter[]'}625 - {name: find, testDoc: '''{1}''th element of ''{0}{if:2} ({2}){end}''', classKey: org.fluentlenium.core.Fluent,626 varLengthArgIndex: 2, key: 'org.fluentlenium.core.Fluent.find-String,java.lang.Integer,org.fluentlenium.core.filter.Filter[]'}627 - {name: findFirst, testDoc: 'first element of ''{0}{if:1} ({1}){end}''', classKey: org.fluentlenium.core.Fluent,628 varLengthArgIndex: 1, key: 'org.fluentlenium.core.Fluent.findFirst-String,org.fluentlenium.core.filter.Filter[]'}629 - {name: goTo, testDoc: 'go to the page ''{0}''', classKey: org.fluentlenium.core.Fluent,630 key: org.fluentlenium.core.Fluent.goTo-String}631 - {name: goTo, testDoc: 'go to the page ''{0}''', classKey: org.fluentlenium.core.Fluent,632 key: org.fluentlenium.core.Fluent.goTo-org.fluentlenium.core.FluentPage}633 - {name: takeScreenShot, testDoc: 'save screen capture to ''{0}''', classKey: org.fluentlenium.core.Fluent,634 key: org.fluentlenium.core.Fluent.takeScreenShot-String}635 - {name: title, testDoc: 'page title of {this}', classKey: org.fluentlenium.core.Fluent,636 key: org.fluentlenium.core.Fluent.title}637 - {name: go, testDoc: 'go to the page ''{this}''', classKey: org.fluentlenium.core.FluentPage,638 key: org.fluentlenium.core.FluentPage.go}639 - {name: isAt, testDoc: 'check that the current page is ''{this}''', classKey: org.fluentlenium.core.FluentPage,640 key: org.fluentlenium.core.FluentPage.isAt}641subClassTable:642 classes:643 - testDoc: home page644 methodKeys: [pages.HomePage.studyBtnClick-void, pages.HomePage.showHistoryBtnClick-void,645 pages.HomePage.analysBtnClick-void, pages.HomePage.historyBtnClick-void]646 type: page647 key: pages.HomePage648 qname: pages.HomePage649 - testDoc: dataSecurity page650 methodKeys: [pages.DataSecurity.dataBtnClick-void, pages.DataSecurity.iosNextBtnClick-void,651 pages.DataSecurity.androidNextBtnClick-void]652 type: page653 key: pages.DataSecurity654 qname: pages.DataSecurity655 - testDoc: login page656 methodKeys: [pages.LoginPage.setUserId-String, pages.LoginPage.setPassword-String,657 pages.LoginPage.okBtnClick-void]658 type: page659 key: pages.LoginPage660 qname: pages.LoginPage661 - {key: javaSystem, qname: javaSystem}662 - {key: junit.framework.Assert, qname: junit.framework.Assert}663 - {key: org.hamcrest.core.Is, qname: org.hamcrest.core.Is}664 - {key: org.hamcrest.core.IsNot, qname: org.hamcrest.core.IsNot}665 - {key: org.hamcrest.CoreMatchers, qname: org.hamcrest.CoreMatchers}666 - {key: org.junit.Assert, qname: org.junit.Assert}667 - {key: org.hamcrest.MatcherAssert, qname: org.hamcrest.MatcherAssert}668 - {key: org.testng.Assert, qname: org.testng.Assert}669 - {key: java.util.List, qname: java.util.List}670 - {key: org.openqa.selenium.By, qname: org.openqa.selenium.By}671 - {key: org.openqa.selenium.remote.RemoteWebDriver, qname: org.openqa.selenium.remote.RemoteWebDriver}672 - {key: org.openqa.selenium.Rotatable, qname: org.openqa.selenium.Rotatable}673 - {key: org.openqa.selenium.support.ui.Select, qname: org.openqa.selenium.support.ui.Select}674 - {key: org.openqa.selenium.WebDriver, qname: org.openqa.selenium.WebDriver}675 - {key: org.openqa.selenium.WebDriver$Navigation, qname: org.openqa.selenium.WebDriver$Navigation}676 - {key: org.openqa.selenium.WebElement, qname: org.openqa.selenium.WebElement}677 - {key: io.appium.java_client.android.AndroidDriver, qname: io.appium.java_client.android.AndroidDriver}678 - {key: io.appium.java_client.AppiumDriver, qname: io.appium.java_client.AppiumDriver}679 - {key: io.appium.java_client.ios.IOSDriver, qname: io.appium.java_client.ios.IOSDriver}680 - {key: io.appium.java_client.MobileBy, qname: io.appium.java_client.MobileBy}681 - {key: org.fluentlenium.core.action.FillConstructor, qname: org.fluentlenium.core.action.FillConstructor}682 - {key: org.fluentlenium.core.domain.FluentList, qname: org.fluentlenium.core.domain.FluentList}683 - {key: org.fluentlenium.core.domain.FluentWebElement, qname: org.fluentlenium.core.domain.FluentWebElement}684 - {key: org.fluentlenium.core.filter.FilterConstructor, qname: org.fluentlenium.core.filter.FilterConstructor}685 - {key: org.fluentlenium.core.Fluent, qname: org.fluentlenium.core.Fluent}686 - {key: org.fluentlenium.core.FluentPage, qname: org.fluentlenium.core.FluentPage}...

Full Screen

Full Screen

home.spec.js

Source:home.spec.js Github

copy

Full Screen

1const nsAppium = require('nativescript-dev-appium')2const assert = require('chai').assert3// eslint-disable-next-line no-unused-vars4const addContext = require('mochawesome/addContext')5describe('home', () => {6 let driver7 before(async function () {8 nsAppium.nsCapabilities.testReporter.context = this9 driver = await nsAppium.createDriver()10 })11 after(async function () {12 await driver.quit()13 console.log('Quit driver!')14 })15 afterEach(async function () {16 if (this.currentTest.state === 'failed') {17 await driver.logTestArtifacts(this.currentTest.title)18 }19 })20 it('compare screen', async () => {21 assert.isTrue(await driver.compareScreen('home-screen'))22 })23 it("show 'Els meus canals' on action bar title", async () => {24 const label = await driver.findElementByText('Els meus canals', 'contains')25 assert.isTrue(await label.isDisplayed())26 assert.isTrue(await driver.compareElement(label, 'action_bar_label1'))27 })28 it('check content home page', async () => {29 })30 it('show search channel page when cliking on button', async () => {31 })32 // it("show 'Els meus canals' on action bar title alt", async function () {33 // const actionBarLabel = await driver.findElementByAccessibilityId('action_bar_label')34 // assert.isTrue(await driver.compareElement(actionBarLabel, 'action_bar_label'))35 // })36 // it('Shows left drawer with nav when clicking on hamburguer icon', async function () {37 // const hamburguerIcon = await driver.findElementByAccessibilityId('hamburguer_icon')38 // // const hamburguerIcon = await driver.findElementByAccessibilityId('hamburguer_icon')39 // await hamburguerIcon.click()40 // assert.isTrue(await driver.compareScreen('home-screen-with-navigation-bar'))41 // })42 //43 // it('Can navigate to home', async function () {44 // const hamburguerIcon = await driver.findElementByAccessibilityId('hamburguer_icon')45 // hamburguerIcon.click()46 // const navLinkHome = await driver.findElementByText('Home', 'contains')47 // assert.isTrue(await navLinkHome.isDisplayed())48 // assert.isTrue(await driver.compareElement(navLinkHome, 'nav_link_home'))49 // // navLinkHome.tap() // DEPRECATED50 // navLinkHome.click()51 // // ASSERT SHOW HOME52 // })53 // it("show 'Els meus canals' on action bar title alt1", async function () {54 // const actionBarLabel1 = await driver.findElementByAccessibilityId('action_bar_label')55 // const actionBarLabel1text = actionBarLabel1.text()56 // console.log(actionBarLabel1text)57 // // assert.isString(actionBarLabel1text)58 // assert.equal(actionBarLabel1text, 'Els meus canals')59 // })60 //61 // it('Shows left drawer with nav when clicking on hamburguer icon', async function () {62 // const hamburguerIcon = await driver.findElementByAutomationText('hamburguer_icon')63 // // const hamburguerIcon = await driver.findElementByAccessibilityId('hamburguer_icon')64 // hamburguerIcon.hamburguerIcon.click()65 // assert.isTrue(await driver.compareScreen('home-screen-with-navigation-bar'))66 // })67 //68 // it('Shows left drawer with nav when clicking on hamburguer icon alt0', async function () {69 // const hamburguerIcon = await driver.findElementByName('hamburguer_icon')70 // // const hamburguerIcon = await driver.findElementByAccessibilityId('hamburguer_icon')71 // hamburguerIcon.hamburguerIcon.click()72 // assert.isTrue(await driver.compareScreen('home-screen-with-navigation-bar'))73 // })74 //75 // it('Shows left drawer with nav when clicking on hamburguer icon alt', async function () {76 // const hamburguerIcon = await driver.findElementByClassName('hamburguer_icon')77 // // const hamburguerIcon = await driver.findElementByAccessibilityId('hamburguer_icon')78 // hamburguerIcon.hamburguerIcon.click()79 // assert.isTrue(await driver.compareScreen('home-screen-with-navigation-bar'))80 // })81 //82 // it('Shows left drawer with nav when clicking on hamburguer icon alt 1', async function () {83 // const hamburguerIcon = await driver.element('id', 'hamburguer_icon')84 // // const hamburguerIcon = await driver.findElementByAccessibilityId('hamburguer_icon')85 // hamburguerIcon.hamburguerIcon.click()86 // assert.isTrue(await driver.compareScreen('home-screen-with-navigation-bar'))87 // })88 // it('Shows left drawer with nav when clicking on hamburguer icon alt1', async function () {89 // const navLinkHome = await driver.findElementByText('Home', 'contains')90 // assert.isTrue(await navLinkHome.isDisplayed())91 // const navLinkSettings = await driver.findElementByText('Settings', 'contains')92 // assert.isTrue(await navLinkSettings.isDisplayed())93 //94 // const navLinkHomeAlt = await driver.findElementByAccessibilityId('nav_link_home')95 // assert.isTrue(await navLinkHomeAlt.isDisplayed())96 // assert.isTrue(await driver.compareElement(navLinkHomeAlt, 'nav_link_home'))97 // const navLinkSettingsAlt = await driver.findElementByAccessibilityId('nav_link_settings')98 // assert.isTrue(await navLinkSettingsAlt.isDisplayed())99 // assert.isTrue(await driver.compareElement(navLinkSettingsAlt, 'nav_link_settings'))100 // })101})102// NOTES ON SPECS103// https://www.nativescript.org/blog/start-testing-your-nativescript-apps-properly104// https://gist.github.com/jeremypele/1dcb3ad317082351a28d5ac0b293cea8105// COMPONENTS DISPLAYED/HIDEEN106// SNAPSHOTS107// it('compare screen', async () => {108// assert.isTrue(await driver.compareScreen('my-whole-screen'))109// })110// SELECTORS:111// - Igual que data-test a nuxt -> aquí automationText112//113// <Button automationText="loginFormSubmit" class="submit btn-primary btn-rounded-sm" text="Submit" (tap)="onSubmit()"></Button>114// Aprofitem el layout:115// - Canviar Home per Canals: la home mostra llista canals subscrits116// - Browse: no cal117// - Search: buscador de canals118// - Settings: TODO119//120// HOME PAGE121// - Title Page: "Els meus Canals"122// - Zero content Page: no hi ha canals123// - CTA: Buscar un nou canal: Botó centrat cerar nou canals124//125//126// SEARCH Channel...

Full Screen

Full Screen

sample.e2e-spec.js

Source:sample.e2e-spec.js Github

copy

Full Screen

1const nsAppium = require("nativescript-dev-appium");2const assert = require("chai").assert;3const addContext = require('mochawesome/addContext');4function assertContains(actual, needed) {5 return assert(actual.includes(needed), `Expected '${actual}' to contain '${needed}'`)6}7describe("sample scenario", () => {8 let driver;9 before(async function() {10 nsAppium.nsCapabilities.testReporter.context = this;11 driver = await nsAppium.createDriver();12 });13 after(async function () {14 await driver.quit();15 console.log("Quit driver!");16 });17 afterEach(async function () {18 if (this.currentTest.state === "failed") {19 await driver.logTestArtifacts(this.currentTest.title);20 }21 });22 it("should find an element by text", async function () {23 let label = await driver.findElementByAccessibilityId('welcomeLabel');24 assert.isTrue(await label.isDisplayed());25 assertContains(await label.text(), 'Blank {N}-Vue app')26 await label.click()27 await label.refetch()28 assertContains(await label.text(), 'Tapped!')29 await label.click()30 await label.refetch()31 assertContains(await label.text(), 'Again')32 });33 it('should navigate to other', async function () {34 await driver.restartApp()35 let button = await driver.findElementByAccessibilityId('gotoOtherButton')36 assert.isTrue(await button.isDisplayed());37 await button.click()38 let label = await driver.findElementByAccessibilityId('otherPageLabel');39 assertContains(await label.text(), 'Other page')40 button = await driver.findElementByAccessibilityId('goBackButton')41 assert.isTrue(await button.isDisplayed());42 await button.click()43 label = await driver.findElementByAccessibilityId('welcomeLabel');44 assert.isTrue(await label.isDisplayed());45 assertContains(await label.text(), 'Blank {N}-Vue app')46 })47 it('should render a list with multiple v-templates', async function() {48 let button = await driver.findElementByAccessibilityId('gotoListButton')49 await button.click()50 let firstLabel = await driver.findElementByText('default template for item first')51 let secondLabel = await driver.findElementByText('second template for item second')52 let thirdLabel = await driver.findElementByText('default template for item third')53 assert.isTrue(await firstLabel.isDisplayed())54 assert.isTrue(await secondLabel.isDisplayed())55 assert.isTrue(await thirdLabel.isDisplayed())56 })...

Full Screen

Full Screen

sample.spec.js

Source:sample.spec.js Github

copy

Full Screen

1describe('basics', () => {2 it('should find an element by text', async () => {3 await new Promise(resolve => setTimeout(resolve, 10000))4 // await this.driver.findElementByAccessibilityId('gotoOtherButton')5 })...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var webdriver = require('selenium-webdriver');2var driver = new webdriver.Builder().forBrowser('chrome').build();3driver.findElement(webdriver.By.name('q')).sendKeys('webdriver');4driver.findElement(webdriver.By.name('btnG')).click();5driver.wait(function() {6 return driver.getTitle().then(function(title) {7 return title === 'webdriver - Google Search';8 });9}, 1000);10var webdriver = require('selenium-webdriver');11var driver = new webdriver.Builder().forBrowser('chrome').build();12driver.findElementByAccessibilityId('q').sendKeys('webdriver');13driver.findElementByAccessibilityId('btnG').click();14driver.wait(function() {15 return driver.getTitle().then(function(title) {16 return title === 'webdriver - Google Search';17 });18}, 1000);19driver.quit();

Full Screen

Using AI Code Generation

copy

Full Screen

1const {Builder, By, Key, until} = require('selenium-webdriver');2const {Options} = require('selenium-webdriver/chrome');3const chrome = require('selenium-webdriver/chrome');4const path = require('chromedriver').path;5const assert = require('assert');6const options = new Options();7options.addArguments('--disable-dev-shm-usage');8options.addArguments('--disable-gpu');9options.addArguments('--no-sandbox');10options.addArguments('--disable-extensions');11options.addArguments('--disable-setuid-sandbox');12options.addArguments('--disable-infobars');13options.addArguments('--window-size=1920,1080');14options.addArguments('--disable-dev-shm-usage');15options.addArguments('--disable-browser-side-navigation');16options.addArguments('--disable-features=VizDisplayCompositor');17options.addArguments('--disable-features=VizHitTestSurfaceLayer');18options.addArguments('--disable-features=VizHitTestQuerySurfaceLayer');19options.addArguments('--disable-features=VizHitTestAggregatedDamage');20options.addArguments('--disable-features=VizHitTestSurfaceLayer');21options.addArguments('--disable-features=VizDisplayCompositor');22options.addArguments('--disable-features=VizHitTestQuerySurfaceLayer');23options.addArguments('--disable-features=VizHitTestAggregatedDamage');24options.addArguments('--disable-features=VizHitTestSurfaceLayer');25options.addArguments('--disable-features=VizDisplayCompositor');26options.addArguments('--disable-features=VizHitTestQuerySurfaceLayer');27options.addArguments('--disable-features=VizHitTestAggregatedDamage');28options.addArguments('--disable-features=VizHitTestSurfaceLayer');29options.addArguments('--disable-features=VizDisplayCompositor');30options.addArguments('--disable-features=VizHitTestQuerySurfaceLayer');31options.addArguments('--disable-features=VizHitTestAggregatedDamage');32options.addArguments('--disable-features=VizHitTestSurfaceLayer');33options.addArguments('--disable-features=VizDisplayCompositor');34options.addArguments('--disable-features=VizHitTestQuerySurfaceLayer');35options.addArguments('--disable-features=VizHitTestAggregatedDamage');36options.addArguments('--disable-features=VizHitTestSurfaceLayer');37options.addArguments('--disable-features=VizDisplayCompositor');38options.addArguments('--disable-features=VizHit

Full Screen

Using AI Code Generation

copy

Full Screen

1var wd = require('wd');2var desiredCaps = {3};4var driver = wd.promiseChainRemote('localhost', 4723);5 .init(desiredCaps)6 .then(function() {7 return driver.findElementByAccessibilityId('Accessibility');8 })9 .then(function(el) {10 return el.click();11 })12 .then(function() {13 return driver.quit();14 })15 .done();16var wd = require('wd');17var desiredCaps = {18};19var driver = wd.promiseChainRemote('localhost', 4723);20 .init(desiredCaps)21 .then(function() {22 return driver.findElementByAccessibilityId('ComputeSumButton');23 })24 .then(function(el) {25 return el.click();26 })27 .then(function() {28 return driver.quit();29 })30 .done();31var wd = require('wd');32var desiredCaps = {33};34var driver = wd.promiseChainRemote('localhost', 4723);35 .init(desiredCaps)36 .then(function() {37 return driver.findElementByAccessibilityId('num1Button');38 })39 .then(function(el)

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 Appium 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