integration-testing

Selenium: retrieve data that loads while scrolling down

佐手、 提交于 2019-12-18 04:21:30
问题 I'm trying to retrieve elements in a page that has an ajax-load scroll-down functionality alla Twitter. For some reason this isn't working properly. I added some print statements to debug it and I always get the same amount of items and then the function returns. What am I doing wrong here? wd = webdriver.Firefox() wd.implicitly_wait(3) def get_items(items): print len(items) wd.execute_script("window.scrollTo(0, document.body.scrollHeight);") # len(items) and len(wd.find_elements-by...())

Automated test tools for Linux/ncurses

心已入冬 提交于 2019-12-18 04:05:48
问题 I've picked up a legacy application developed in C/C++ on Linux, using ncurses for UI. What automated testing tools are there for this environment? Edit: I've used AutomatedQA TestComplete in the past, and this is the type of tool I'm looking for - except running on Linux, and with the ability to test Text UI apps. 回答1: I wrote something like that before. Not much docs, but you can try the code. It's written in Python and runs on Linux. You would basically need the ANSIterm filter, and the

Maven - separate integration tests from unit tests

与世无争的帅哥 提交于 2019-12-18 03:16:16
问题 Is it possible to isolate integration tests from unit tests within same module? I created simple pom: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <artifactId>prj</artifactId> <packaging>war</packaging> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins

Chrome Dev Tools API & Selenium WebDriver

拥有回忆 提交于 2019-12-18 02:09:12
问题 I am experimenting with Selenium Web Driver for automating my browser integration tests. I see that Chrome Dev Tools comes with a console API for invoking certain dev tool functions from inside JavaScript. Ideally, from inside my Java/JUnit integration test, I could start the Chrome Dev Tool memory profiler (and perhaps some other tools), run my WebDriver tests (instantiating a Chrome browser instance, manipulating DOM elements, etc.), and then stop the profiler, then inspect the profiler's

How to write unit tests for database calls

和自甴很熟 提交于 2019-12-17 23:36:53
问题 I'm near the beginning of a new project and (gasp!) for the first time ever I'm trying to include unit tests in a project of mine. I'm having trouble devising some of the unit tests themselves. I have a few methods which have been easy enough to test (pass in two values and check for an expected output). I've got other parts of the code which are doing more complex things like running queries against the database and I'm not sure how to test them. public DataTable ExecuteQuery(SqlConnection

How to use redirection in cmake add_test

折月煮酒 提交于 2019-12-17 20:25:01
问题 I have a console application called "foo", which takes a reference text file as input (in.txt) and generates text at standard output (I want to keep this behaviour). In make (not cmake), I use a test target, which calls foo and redirects the output to a file (out.txt) as follows. Then, I use diff to compare the file out.txt with the expected refernece (ref.txt) test: ./foo -a test/in.txt > test/out.txt diff test/out.txt test/ref.txt This works fine using make. Now my question is; how can I

How do you test an Android application across multiple Activities?

痞子三分冷 提交于 2019-12-17 17:28:18
问题 We are building a complex Android application consisting of many screens and workflows spread across many Activities. Our workflows are similar to what you might see on a Bank's ATM machine, for example, there is an Activity to login in that transitions to a main menu Activity which can transition to other activities based on the user's choices. Since we have so many workflows we need to create automated tests that span multiple activities so we can test a workflow from end to end. For

Java, Junit - Capture the standard input / Output for use in a unit test [duplicate]

百般思念 提交于 2019-12-17 15:53:49
问题 This question already has answers here : JUnit test for System.out.println() (12 answers) Closed 5 years ago . I'm writing integration tests using JUnit to automate the testing of a console based application. The application is homework but this part isn't the homework. I want to automate these tests to be more productive -- I don't want to have to go back and retest already tested parts of the application. (Standard reasons to use Unit tests) Anyway, I can't figure out or find an article on

How are integration tests written for interacting with external API?

。_饼干妹妹 提交于 2019-12-17 15:10:03
问题 First up, where my knowledge is at: Unit Tests are those which test a small piece of code (single methods, mostly). Integration Tests are those which test the interaction between multiple areas of code (which hopefully already have their own Unit Tests). Sometimes, parts of the code under test requires other code to act in a particular way. This is where Mocks & Stubs come in. So, we mock/stub out a part of the code to perform very specifically. This allows our Integration Test to run

Creating test data in a database [closed]

早过忘川 提交于 2019-12-17 09:33:17
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I'm aware of some of the test data generators out there, but most seem to just fill name and address style databases [feel free to