automated-tests

How to not stop execution after assertion fails? [duplicate]

╄→尐↘猪︶ㄣ 提交于 2020-01-16 00:36:18
问题 This question already has answers here : How to continue execution when Assertion is failed (5 answers) Closed 4 years ago . I'm using Selenium WebDriver + Java + TestNG for automation. In my test methods, sometimes there are more than one assertions. Suppose, there are four assertions and second assertion fails, then rest of the execution is terminated. What I want is - even after second assertion fails, code after it should be executed. And at the end(after test method is executed), it

AndroidManifest.xml and tests in Android Studio

点点圈 提交于 2020-01-15 12:23:49
问题 I have a basic Android project with an application sources directory and tests sources directory set up by the Android Project template. I have read that Android tests uses an Androidmanifest.xml specific to the running tests in which we have to specify the instrumentation type and the target package: <instrumentation android:name="android.test.InstrumentationTestRunner" android:targetPackage="com.mypackage.app" /> In Android Studio,I can run tests with android tests configuration without

AndroidManifest.xml and tests in Android Studio

ぐ巨炮叔叔 提交于 2020-01-15 12:22:52
问题 I have a basic Android project with an application sources directory and tests sources directory set up by the Android Project template. I have read that Android tests uses an Androidmanifest.xml specific to the running tests in which we have to specify the instrumentation type and the target package: <instrumentation android:name="android.test.InstrumentationTestRunner" android:targetPackage="com.mypackage.app" /> In Android Studio,I can run tests with android tests configuration without

How can I access the application using selenium webdriver that works through VPN?

℡╲_俬逩灬. 提交于 2020-01-15 12:15:29
问题 For example, I have an application "www.test.com", to access this site I have installed browsec VPN in firefox then I can see the application content - accessing the site without vpn I get an error of "Your IP Address has been blocked..bla bla" Now I want to test some UI of that site through Selenium Webdriver, but when I try to access the site via selenium webdriver I get same error of IP blocked since the vpn is already installed on firefox, but webdriver doesn't bother the VPN - that's my

MSBuild to run unit tests

早过忘川 提交于 2020-01-15 05:55:07
问题 I am trying to configure CruiseControl .net to build our repository code periodically and run the tests included in the solution. I have configured the retrieving code from the svn server and building part. But I am unable to run tests on it. MSBuild keeps on complaining that. error MSB4057: The target "Test" does not exist in the project. I also tried running the tests through command line to see if that works with the same error. I used: MSBuild.exe TestProject.csproj /t:Test My

Browser detection using user agent in fixture hooks

旧时模样 提交于 2020-01-15 03:54:07
问题 I have a few tests that only need to be run when in a mobile browser. Currently I have a client function to check the user agent. const checkMobile = ClientFunction(() => /iPhone|Android/i.test(navigator.userAgent)) Which I then access inside my tests: test("Check if mobile", async t => { const isMobile = await checkMobile(); if (isMobile) { await t // do the tests } } Is there a way for me to use this in a fixture? Like a fixture which will only run if checkMobile is true ? So I don't need

How to scroll to bottom of div element Selenium Webdriver

对着背影说爱祢 提交于 2020-01-14 22:56:12
问题 I have a use case wherein there's a div element on the webpage, it appears like a popup dialog as soon as you click a link (its not an actual popup, its something like dialog boxes which opens in Facebook when you click a link to check reactions on your posts etc.) I'm using Selenium WebDriver with Java to automate tests for this application, my use case involves me to scroll to the bottom of the dialog box where there is a link to show more items, when user clicks show more, it populates

How to stop loop in cypress

筅森魡賤 提交于 2020-01-14 19:12:50
问题 I have a loop checking 40 items. I want to stop my loop, when I am finding the first element, which > 0 This is my code var genArr = Array.from({ length: 40 }, (v, k) => k + 1); cy.wrap(genArr).each((index) => { cy.get('.list-item').eq(index - 1).find('.number') .invoke('text') .then(text => { const pendingCount = text; cy.get('.list-item').eq(index - 1).click(); cy.get('.list-table').find('.list-table-list-item') .should('have.length', pendingCount); if (text > 0) break }); }); }); But I

How to stop loop in cypress

我怕爱的太早我们不能终老 提交于 2020-01-14 19:11:08
问题 I have a loop checking 40 items. I want to stop my loop, when I am finding the first element, which > 0 This is my code var genArr = Array.from({ length: 40 }, (v, k) => k + 1); cy.wrap(genArr).each((index) => { cy.get('.list-item').eq(index - 1).find('.number') .invoke('text') .then(text => { const pendingCount = text; cy.get('.list-item').eq(index - 1).click(); cy.get('.list-table').find('.list-table-list-item') .should('have.length', pendingCount); if (text > 0) break }); }); }); But I

Check if test failed in afterEach of Jest

大憨熊 提交于 2020-01-14 10:07:48
问题 When one of my Jest tests fails I want to store a screenshot, but only when it fails. Here is a piece of my test code as an example, the !passed part in the afterEach is not working. describe('Page', () => { it('should contain Text in the header', async () => { // Arrange const page = new Page(driver); // Act await page.open(); // Assert expect(await page.getHeaderText()).toBe('Something'); }); afterEach(async () => { if (!passed) takeScreenshot(); await driver.quit(); }); }); With jasmine I