Menu
  • HOME
  • TAGS

Get attribute from table - Protractor

javascript,testing,protractor,end-to-end

xpath is your friend when you need exact value matching. This should do the trick: element.all(by.xpath('.//td[.="91" and @class="ultranarrow ng-binding"]')).click(); ...

Overriding TestNG Summary

java,testing

After looking a lot thru source code it does not seem that this will happen. The only alternative is changing the src code and building testng yourself.

Selenium when to use By id/name/class/spath/css, and page object

java,selenium,testing

you should use the selector that are the easier to understand when reading your test (good for maintenance) and the more chances to be stable in time (good for maintenance as well). So usually, id and name are better than cssSelector and xpath. It is OK to combine all...

Play 2.3.x: Multiproject, disable BoneCP

scala,testing,playframework,playframework-2.3,specs2

Finally get it ! val withoutPlugins = Seq(classOf[ReactiveMongoPlugin].getName) Worked like a charm for disabling ReactiveMongo Plugin. And for the main problem: additionalConfiguration = Map("dbplugin" -> "disabled", "evolutionplugin" -> "disabled") No JDBC at all during tests. Thank you a lot Barry !...

How to use tests in Xcode (iOS application)

ios,objective-c,iphone,xcode,testing

These are called Unit Tests and you can test your components, like classes and functions, with them. You write a Test and if you change something on your classes, the test will show you if the class still works as expected. For an example: http://www.preeminent.org/steve/iOSTutorials/XCTest/ You should also read a...

Python Django REST API test

python,django,testing,django-rest-framework

Thanks guys for your input. I found out that I should be using APITestCase instead of TestCase for DRF. I have Implemented both of your answers into my test script and I have got a working test script that looks like this: from customer.models import Customer, CustomerStatus from customer.views import...

undefined local variable or method `start_test_server_in_background' for #

testing,cucumber,calabash,calabash-ios

The recommend way of launching the application is to use: options = { } launcher.relaunch(options) launcher.calabash_notify(self) In your support/env.rb file you need to: require 'calabash-cucumber/cucumber' not calabash-cucumber....

Rspec view test with url parameters

ruby-on-rails,unit-testing,testing,rspec,rspec-rails

Because these are redirects, controller testing with render_views will not work. Nope, you are just doing it wrong. If StaticpagesController#dashboard accepts url parameters you should test how it responds to said parameters in the controller spec for StaticpagesController. RSpec.describe StaticpagesController, type: :controller do describe 'GET #dashboard' do render_views it...

Test if an object conforms to an interface in TypeScript

testing,typescript

asserts object conforming to my interface You have to do it manually: expect(typeof object.name).to.eql("string"); // so on Update : Writing code to do the deep assertion for you Since the type information TypeScript sees is removed in the generated JS you don't have access to the type information in...

how to spy on linux binaries for testing of shell scripts

linux,bash,shell,testing,spy

Just an idea, I didn't see this anywhere but: Unless you're using full paths to invoke those binaries, you could create mocks of those libraries, e.g., in your projects bin/ directory and make that directory be the first in your $PATH. export PATH="$PWD/bin:$PATH" To mock grep, for example, you could...

nose reports cumulative coverage

python,unit-testing,testing,nose

Your tests are running the code in BASE_CLASS. Python doesn't just know what in the base class when creating sub class instances. It has to go to the base class and look at the code there. If you want to see how good your coverage for that particular base class...

Gradle configuring TestNG and JUnit reports dirs

testing,junit,gradle

Take a look at the DSL reference for Test. There you can find a reports property at https://docs.gradle.org/current/dsl/org.gradle.api.tasks.testing.Test.html#org.gradle.api.tasks.testing.Test:reports This gives you a TestTaskReports. Following this route in the DSL leads you to: task testNG(type: Test) { useTestNG {} reports.html.destination = file("$buildDir/reports/testng") } test { reports.html.destination = file("$buildDir/reports/test") dependsOn testNG }...

rspec controller empty session

ruby-on-rails-3,testing,rspec,controller

Try: expect(session['dr']).to eq("dr"). session values are separate from assigns....

Not able to click ExtJS Dropdown button and select list elements - Selenium Webdriver Java

java,selenium,testing,extjs,selenium-webdriver

Try using explicit wait with more precise selectors. By css = By.cssSelector("[placeholder='Please Select a Customer...']"); By option = By.xpath("//li[@role='option'][text()='Customer 2']"); WebDriverWait wait = new WebDriverWait(driver, 10); //Click the dropdown to populate the list WebElement dropdown = wait.until(ExpectedConditions.presenceOfElementLocated(css)); dropdown.click(); //Click the option. Notice the xpath is using the text of the...

Protractor map function returning undefined

javascript,selenium,testing,selenium-webdriver,protractor

This confused me so I thought I'd add an answer to help others... While I understood that map() returns a promise, because I was using it in an expect, I thought it would be resolved, and then should act like an array. Nope. It returns an object, that looks like...

How can performed method setUp only once in tests

java,testing,junit,integration-testing

I believe the problem you are trying to solve should be done in a different way. As far as I see you want to fill your DB with some test data, and this is better to do in a global configuration for all tests. But if you want to stick...

Angularjs: Testing controller function, which changes $scope

angularjs,testing,jasmine

try calling $scope.$digest() after deleteAccount. This is needed because tests don't have digest cycles the same way it runs normally in the browser. $scope.deleteAccount($scope.accounts[0]); $scope.$digest(); expect($scope.accounts).toEqual([{_id: 2}, {_id: 3}]); ...

How to get notified when unfiltered Netty server actually gets shutdown?

scala,testing,netty,unfiltered

Easy answer: replace your Unfiltered Netty server with a HTTP4S Blaze server. var server: org.http4s.server.Server = null val go: Task[Server] = org.http4s.server.blaze.BlazeBuilder .bindHttp(mockServicePort) .mountService(mockService) .start before { server = go.run } after { server.shutdown.run } There's also an awaitShutdown that blocks until the server shuts down. But since shutdown is...

How to test a meteor method that relies on Meteor.user()

testing,meteor,jasmine

In your jasmine test you can mock a call to Meteor.user() like so: spyOn(Meteor, "user").and.callFake(function() { return 1234; // User id }); ...

Grails Test Domain Model - Mocks

unit-testing,grails,testing

Yes, you will get NullPointerException in the assert condition. The reason being that, you are creating instance of EventDate in the extendDates method but you are not really adding it to the eventDates list in Appointments domain. So, you have to modify your that method something like: // Initialize with...

Send existing LCOV file to SonarQube

javascript,testing,sonarqube,code-coverage

Not sure to understand the question, but if it is how to feed SonarQube with the LCOV report, so you just need to provide the path - absolute or relative to the project base directory - to the LCOV report via the project property "sonar.javascript.lcov.reportPath". See http://docs.sonarqube.org/display/PLUG/JavaScript+Plugin "Code Coverage" paragraph....

Android Studio can not find AndroidJUnit4.class + tests fail

android,testing,android-studio

Now that dexmaker 1.3 and android test support runner 0.3 are released, this started working: androidTestCompile "junit:junit:${JUNIT_VERSION}" androidTestCompile "com.android.support:support-v4:${SUPPORT_V4_VERSION}" androidTestCompile "com.android.support:recyclerview-v7:${SUPPORT_LIBRARY_VERSION}" androidTestCompile "org.mockito:mockito-core:${MOCKITO_VERSION}" androidTestCompile "com.crittercism.dexmaker:dexmaker:${DEXMAKER_VERSION}" androidTestCompile "com.crittercism.dexmaker:dexmaker-dx:${DEXMAKER_VERSION}"...

Ignore synchronization for $http, but not $timeout

javascript,angularjs,selenium,testing,protractor

Currently, you have to tweak ignoreSynchronization - set it to true, check the form and set it back to false after. There is something more convenient about it coming in the future, stay tuned: Make it easier to control when ignoreSynchronization is off or on ...

How to exclude generated code from coverage statistics

testing,go

This help message from go test seems to suggest you can filter the packages you're testing: -coverpkg pkg1,pkg2,pkg3 Apply coverage analysis in each test to the given list of packages. The default is for each test to analyze only the package being tested. Packages are specified as import paths. Sets...

testing non returning method in go

testing,go

First: You wouldn't name a method "doFunctionOne" but "methodOne" :-) If neither doFunctionOne nor doFunctionTwo has any observable effect, then there is absolutely no point in testing it. So we may assume that they do have observable side effect, either on the environment or on the customType they have been...

Config.properties returns value only when called twice

java,testing,junit

Can you pls try this... if(foundFile()) { return prop.getProperty("DAILY-DMS.instances"); } prop object is populated only after foundFile() call, however you are reading the data in a prior line. Also, unless you are updating the config file in runtime, I would recommend you read the properties file one and store it...

How can I get simulated react events to update the values of the ref in my component?

javascript,unit-testing,testing,reactjs,reactjs-testutils

You're missing an onChange handler for your input fields which React will then render as uncontrolled inputs. <input onChange={this.handleChange} /> in combination with setting a new state will fix your issues. handleChange: function(event) { this.setState({value: event.target.value}); } React docs explains it here...

setting up fake data in mongodb for testing

database,node.js,mongodb,testing,mongoose

You could try to write json files instead of code and use mongoimport to recreate your database. That's easier to maintain than kilometers of very verbose and repetitive code.

Protractor - Where to use browser.waitForAngular()

javascript,angularjs,testing,protractor,angularjs-e2e

From protractor's documentation: Instruct webdriver to wait until Angular has finished rendering and has no outstanding $http or $timeout calls before continuing. Note that Protractor automatically applies this command before every WebDriver action. You shouldn't be calling this at all and I cannot think of a valid case where you...

Can't get the value in an input with protractor

javascript,angularjs,selenium,testing,protractor

Normally getAttribute('value') should work. getText() won't work because input elements don't have inner text. expect(element(by.id('rank-max-range')).getAttribute('value')).toEqual(2); Have you tried to log the result of getAttribute('value')?...

Transferring large application to Android Wear through Android Studio

android,debugging,testing,android-wear,large-files

The dock that comes with the LG G Watch R can also be plugged into the computer, allowing you to use the much faster USB connection to install your Wear app.

Upload file - Protractor

javascript,selenium,testing,protractor,end-to-end

The common and the most realistic way to upload the file via protractor/selenium is to send keys to the file input and avoid opening the upload file dialog which you cannot control: var uploadInput = element(by.css("input[type=file]")); uploadInput.sendKeys("path/to/file"); ...

Comparasion of Integer.equals() and Objects.equals()

java,testing,equals

Because the JIT kicks in, and detects that Random.nextInt() and equals() are two methods that are often called, and that optimizing them is thus useful. Once the byte-code is optimized and transformed to native code, its execution is faster. Note that what you're measuring is probably more Random.nextInt() than equals()....

Expect fails for verifying inner HTML

jquery,selenium,testing,jasmine,protractor

Use getInnerHtml() expect($('.your-css').getInnerHtml()).toBe('your inner html'); http://angular.github.io/protractor/#/api?view=webdriver.WebElement.prototype.getInnerHtml...

Mock class inside REST controller with Mockito

java,testing,junit,spring-boot,mockito

Shouldn't you be passing an instance to set the field on, rather than the class, e.g.: ... @Autowired private Controller controller; ... @Before public void setUp() throws Exception { ... Processor processor = Mockito.mock(Processor.class); ReflectionTestUtils.setField(controller, "processor", processor); } ...

CMake and CTest: automatically run test's dependencies

c++,c,testing,cmake,ctest

There's no built-in way of doing this as far as I know. The best way I can think of to achieve your goal is to use the LABELS property on the tests. You can retrieve the list of dependencies using get_property or get_test_property and apply the same label to testX...

NPE when calling MockitoAnnotations.initMocks() in AndroidTestCase

java,android,testing,gradle,mockito

You could try to replace MockitoAnnotations.initMocks(this); with this System.setProperty("dexmaker.dexcache", getContext().getCacheDir().getPath()); It works for me. See ref here...

How does one test net.Conn in unit tests in Golang?

unit-testing,testing,tcp,go

Although it will depend on the implementation details of your particular case, the general approach will be to start a server (in a separate goroutine, as you already hinted), and listen to the incoming connections. For example, let's spin up a server and verify that the content we are reading...

how to return object from protractor

javascript,angularjs,selenium,testing,protractor

First of all, you are not returning anything from your function. Besides, from what I understand, you need to filter the table and get the text values of a cell in a specific column (cell having a specific class name, e.g. colt0). Use map(): function fetch_text_from_cell_in_table (col_val) { return element.all(by.repeater('row...

How to write JUnit tests with progressive state

java,testing,junit

There are only a handful of things that I can identify as worth testing: getCol(int) getValue(int, String) getValue(int, int) potentially getNewRow() The reason I say this: you're relying on ArrayList for most of your functionality, and you should not test anything that exclusively delegates to a known and tested class....

Unable to trace an element by attribute or text

java,testing,selenium-webdriver,webdriver

Well, for one, your xpath selector is incorrect. driver.findElement(By.xpath("li[data-tab='tabAdress']")).click(); should be: driver.findElement(By.xpath("//li[@data-tab='tabAdress']")).click(); edit: And your css selector is incorrect as well. driver.findElement(By.cssSelector("li[data-tab=tabAdress")).click(); should be: driver.findElement(By.cssSelector("li[data-tab='tabAdress']")).click(); edit #2: and: driver.findElement(By.linkText("Account Details")).click(); will only work if the element is a link, which in this case it is not....

Javascript Regex: “Any word” pattern

javascript,regex,testing,jasmine,karma-jasmine

Use + to repeat the previous token one or more times. \\w alone will match a single word character only. expect(item.getIconToolTip()).toMatch('Request \\w+ for \\w+ - Open actions menu'); ...

About the android robotium release

android,testing,robotium

You always may launch your tests from the command line with adb adb shell am instrument -w yourproject.com/android.test.InstrumentationTestRunner However I would recommend you take a look on the Spoon project that may help with the test instrumentation and distribution....

running same test with different dataprovider in testng

java,testing,automation,testng,testng-dataprovider

What about to use one data provider which returns different data - based on current test group: @DataProvider(name = "myDataProvider") public Object[][] testDataProvider(ITestContext context) { List<String> includedGroups = Arrays.asList(context.getIncludedGroups()); if(includedGroups.contains("myGroup")) { return dataA; } else if (includedGroups.contains("myOtherGroup")) { return dataBC; } //... } ...

Count Sort Algorithm, Unable to sort Perfectally

c#,performance,algorithm,sorting,testing

Try Following I<=Max in 3rd Loop Sorted_Array[C[Array[j]]-1] = Array[j] In 4th Loop int[] Counting_sort(int[] Array, int Max) { int No_Of_Elements = Array.Length; int[] Sorted_Array = new int[Array.Length]; int[] C = new int[Max+1]; for (int i = 0; i < Max; i++) { C[i] = 0; } for (int j =...

Protractor: cleanup after test suite is finished

javascript,selenium,testing,protractor,end-to-end

From what I understand, there is no place in protractor to provide "before test suite" or "after test suite" logic (correct me if I'm wrong about it). The idea is to use afterEach(), try switching to the alert, dismiss() it if exists (or accept() depending on what you need), do...

Jhipster - JpaRepository “principal.username” @Query - org.springframework.expression.spel.SpelEvaluationException

testing,spring-security,jhipster

In my project, I have a repository that uses #{principal.username} in one of its queries. Here's what it looks like: public interface BlogRepository extends JpaRepository<Blog, Long> { @Query("select blog from Blog blog where blog.user.login = ?#{principal.username}") List<Blog> findAllForCurrentUser(); } My BlogResource controller calls this as follows: @Timed public List<Blog> getAll()...

cmocka free operation and catching exceptions

c,unit-testing,testing,cmocka

I'd suggest just doing an additonal test with valgrind. valgrind --error-exitcode=1 ./test Without the option valgrind would always return the same exit code returned by your test program. This way if your test program succeeds, but valgrind's memory check reveals errors, it will return 1 to indicate an error....

Why do i need a constructor in an abstract class?

java,testing,junit,junit4

Why do i need a constructor in the abstract class AthleteTest?My understanding is that because it is abstract, it will not be instantiated, therefore there is no need for a constructor as constructors only come into play when the class is instantiated. Abstract classes cannot be instantiated directly -...

database restore for integration tests with phpunit

php,testing,phpunit,integration-testing

This is what DbUnit is all about. Have you looked at it?

Testing template based class with const template parameter which has to be varied

c++,templates,testing,const,const-cast

You can simulate a for loop using template meta programming. #include <iostream> typedef int ValueType; template<int INT_BITS, int FRAC_BITS> struct fp_int { public: static const int BIT_LENGTH = INT_BITS + FRAC_BITS; static const int FRAC_BITS_LENGTH = FRAC_BITS; private: // Value of the Fixed Point Integer ValueType stored_val = 0; };...

How to inspect code behind Swing GUI

java,swing,testing

This is what I'm looking for : "Swing Explorer" http://www.ibm.com/developerworks/library/j-swingtest/

Django testing wastes too much time on test database creating

python,django,testing,django-testing

You can use django-nose and reuse the database like this: REUSE_DB=1 ./manage.py test Be careful that your tests do not leave any junk in the DB. Have a look at the documentation for more info....

Is it possible to write a MATLAB script that can give command line input to a function?

matlab,testing,input

If you are looking for a non elegant solution. If you are looking for a potentially dangerous solution. Then you might try this: write a function named "input" as follows: function a=input(str) % THIS IS THE DUMMY VERSION OF THE % MATLAB BUILT-IN FUNCTION "input" global dummy_input disp('WARNING!!!') disp('MATLAB "input"...

Rails testing error: argument of WHERE must be type boolean, not type integer

ruby-on-rails,testing

This is not a complete answer, but I can't post comments (not enough reputation). Have you tried to look at the SQL queries made? You can show them in test environment, check this question. And, in postvoterelationships_controller.rb, I think: @post = Postvoterelationship.find_by(params[:id]).voted should be: @post = Postvoterelationship.find(params[:id]).voted ...

How to run mtouch command to launch Xamarin.iOS app on simulator for automated testing?

testing,xamarin,monotouch

mtouch -launchsim Hello.app mtouch docs are here On a Mac, the mtouch binary should be here /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch ...

How does Robot's Telnet library work?

python,testing,robotframework

Telnet library uses some introspection magic, supported by RF dynamic library interface. When Telnet library is taken into use, get_keyword_names is called. This inspects also the TelnetConnection class for it's own methods and registers these as keywords. During execution RF calls e.g. Telnet.write, which is handled by the __getattr__ method,...

how to autowire in spring for test classes?

spring,testing

Here is a skeleton of how your test class should look like @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("classpath:applicationContext.xml") @TransactionConfiguration(transactionManager = "<< YOURTRANSACTIONMANAGER >>", defaultRollback = true) @Transactional public class ServiceTest { //The name of your resource/service should be the same as defined in your bean definition @Resource private YourService service; @Test public void testYourService()...

Testing for asynchronous results without sleep in Go

unit-testing,testing,go

Soheil Hassas Yeganeh's solution is usually a good way to go, or at least something like it. But it is a change to the API, and it can create some overhead for the caller (though not much; the caller doesn't have to pass a Done channel if the caller doesn't...

testing - How to approach integration tests that create new data

testing,junit,automated-tests,integration-testing

You could use one of the following: If possible use an in memmory database like hsqldb, which you can re-create or setup suitably for each TestSuite/TestCase If the methods under test are transactional, run the test case with spring junit rollback true If you cannot use 1 or 2, you...

python cross platform testing: mocking os.name

python,testing,mocking,nose

According to Where to path you should patch os_name in production_code instead of os.name. Moreover write your test by use decorator form instead with structure make it more readable: class TestProduction(object): @patch("production_code.os_name","posix") def test_platform_string_posix(self): assert_equal('posix-y path', production.platform_string()) ...

Protractor - How to get first or last CHILD value

angularjs,testing,protractor

The HTML you've provided suggests by.binding locators can be used, but you haven't provided the actual bindings - you can see them in the non-rendered HTML source code, e.g. should be smth like: <strong class="ng-binding">{{ vehicle.manufacturer }}</strong> In this case, you could've located the desired elements this way: var div...

Does a Fuzz Testing Tool use the TCP/IP Stack of the Operating System?

testing,fuzzing,fuzz-testing

Any tool that doesn't rely on kernel modifications will have to go through the OS's networking stack. This doesn't mean that they necessarily have to use the networking stack's TCP/IP support: many OSes support APIs like SOCK_RAW+IP_HDRINCL (Windows, BSD, OS X)/PF_PACKET (Linux) which lets you build your own packets (which...

Visual Studio 2012 - Fill message test result

c#,asp.net,unit-testing,visual-studio-2012,testing

I've found this solution considering the TestContext that i have in my .cs file private TestContext testContextInstance; public TestContext TestContext { get { return testContextInstance; } set { testContextInstance = value; } } i used this method TestContext.WriteLine("message"); So in my output i see the message that i log....

Dynamic expectations in Rspec

ruby-on-rails,ruby,testing,rspec,tdd

You can use plain string interpolation: expect(current_path).to eq "/users/#{ User.last.id }" Or a route helper: expect(current_path).to eq user_path(User.last) ...

How to make grunt run some tasks at a special point in time?

javascript,node.js,testing,gruntjs,automated-tests

Grunt-contrib-watch makes you to do some task when the inspected file has changed. grunt-crontab can let you do some task at specific time, just like crontab. e.g in grunt setting: grunt-crontab example. { "jobs" : [ { "command": YOUR COMMAND, "schedule": "0 1 * * *", //Every day's 1:00...

How to verify `onclick` event in javascript for an Anchor tag using selenium webdriver

html,testing,selenium-webdriver,automation

As far as I understand you wish to verify the following onclick JS event: window.open('https://www.facebook.com/sharer.php? s=100&p[title]=...

Pick out certain lines from files

list,testing,tcl

It shouldn't be hard. To begin with, you probably want to split the file's contents at the line breaks: set data [split [string trim [read $f]] \n] When you've done that, you could use a number of techniques to select the lines you want, for instance lsearch -all -inline $data...

How to stub Time.now.hour

ruby-on-rails,testing,time,rspec,stubbing

Another approach would be to use Timecop (or the new Rails replacement travel_to) to stub out your time for you. With Timecop you can have super readable specs with no need for manual stubbing: # spec setup Timecop.freeze(Time.now.beginning_of_day + 11.hours) do visit root_path do_other_stuff! end ...

Django Test Case Can't run method

python,django,testing

Verify whether your unit test comply the followings, TestClass must be written in a file name test*.py TestClass must have been subclassed from unittest.TestCase TestClass should have a setUp function to create objects(usually done in this way, but objects creation can happen in the test functions as well) in the...

How do I log into a web service that was auto-generated by Azure Mobile Web Services?

c#,testing,azure-mobile-services,visual-studio-2015

Leave the user name blank. And put in your application key as password. You can find your application key from your Azure portal > Mobile service > manage keys. The reason being is that AMS uses a Zumo header to decide proper authentication. Which is what the application key is...

Load additional CONFIG file with values

javascript,selenium,testing,protractor,end-to-end

To follow the "DRY" principle, use your protractor config and globally available browser object: in your protractor config, "import" your configuration file and set it as a params value: var config = require("./config.js"); exports.config = { // ... params: config, // ... } in your tests, simply use browser.params, e.g.:...

Appium: isDisplayed() vs findElements(by).size

java,iphone,testing,automation,appium

This is mostly Selenium question. When you use findElements you are looking for the presence element in DOM. However the element presence still not ensure that the element will visible. In order to verify the element display state you have to use isDisplayed method. Fore example in case the large...

SQL Server procedure optimization testing pattern improvement

sql-server,testing,sql-server-2014

you can use this query SELECT total_elapsed_time FROM sys.dm_exec_query_stats WHERE sql_handle in (SELECT most_recent_sql_handle FROM sys.dm_exec_connections CROSS APPLY sys.dm_exec_sql_text(most_recent_sql_handle) WHERE session_id = (@@spid)) ...

Element is not clickable at point - Protractor

javascript,testing,protractor,end-to-end

The combo-box from the error message is still open when you are trying to click on the vehicle-condition element - most probably due to its closing/fade-out animation. You can try to disable animations for your tests globally, locally or wait for the overlaying element to disappear: var EC = protractor.ExpectedConditions;...

How to run a Perl Dancer Test

perl,testing,dancer

You should remove dancer() from the WebApp.pm. Here is the correct content: package WebApp; use Dancer; # declare routes/actions get '/' => sub { "Hello World"; }; 1; Then you test will pass. The common way to create dancer apps is to declare all the routes in one or more...

Visual Studio 2012 Ordered Test, how to monitor test execution

c#,visual-studio-2012,testing,ordered-test

Visual Studio supports ordered tests as explained here. You have to add an Ordered Test to your solution which can contain actual unit tests. Within the ordered test, you can define which test is executed in which order. If you want to view some progress indication while your tests run...

How to get the value from selectbox?

javascript,selenium,testing,protractor,end-to-end

You are closing the parenthesis in the wrong place and there is no expect(). Replace: element(by.cssContainingText('option', browser.params.lengthUnit).getAttribute("value")).toEqual(browser.params.lengthUnit); with: var option = element(by.cssContainingText('option', browser.params.lengthUnit)); expect(option.getAttribute("value")).toEqual(browser.params.lengthUnit); If you are dealing with select->option constructions a lot, consider using an abstraction over it that would make your tests cleaner and more readable, see: Select...

How to log in/out users with Devise in Rails4 testing

ruby-on-rails,ruby,ruby-on-rails-4,testing,devise

This is from their docs: "Do not use Devise::TestHelpers in integration tests." You have to sign in manually. This is an example of a test for a website that does not allow users to get to the root path unless signed in. You can create a method in a support...

Where to put external files for testthat tests

r,testing,testthat

You put these in the testthat folder (inside tests). There, you include any "external" file that you might use for your tests (or that provides some additional explanation that the user might find informative, such as in a ".txt") file. You also have your .r testfiles here. Alternatively (or, in...

Penetration testing for PHP security vulnerabilities

php,security,testing,penetration-testing

It all boils down to what you want; you may use Burp Suite which is a great manual pentesting tool with a nice community and resource online that allows you to perform pen tests efficiently. You might want to try automatic web application scanners such as Acunetix Web Vulnerability Scanner...

How do I check enable and disabled button using helium?

testing,automation,qa,helium

error: Cannot find element ButtonImpl(">") We need to check the presence of the class (prev btn btn-warning disabled or next btn btn-warning ) in the code. element ">" is not on the page is a picture. UPD: if (driver.findElements(By.xpath("someXpath")).size == 0) or $(By.xpath("someXpath")).shouldNotBe(visible); Code in Java: public static boolean isElementPresent(By...

Browser.wait() until .getAttribute() returns true

javascript,angularjs,selenium,testing,protractor

You are missing the return from the wait condition function: browser.wait(function() { return topping.getAttribute('aria-expanded').then(function(value) { return value == 'true'; }); }, 5000); Note that I've also simplified the comparison logic inside the then callback. Or, you can also wait for the option element to become visible: var EC = protractor.ExpectedConditions;...

Ruby on Rails - Testing changes to Capistrano's deploy.rb

ruby-on-rails,testing,deployment

Is there any way I can redeploy changes to the server without having to push it to Github first? No this isn't possible since one of the first things that Capistrano will do is git clone the latest from whatever branch you've specified in your deploy config. I'm not...

How to select the nth html element in a table that has special class?

javascript,html,css,testing,nightwatch.js

The only way I can think of accessing multiple .sorting_3 elements, without knowledge of how Nightwatch.js actually works, is to pass it siblings ~ combinator selector. i.e.: when you want to select the first element out of .sorting_3 elements, you would do this: .getText('td[class="sorting_3"]', function(result){ this.assert.equal(result.value, 'Testbenutzer'); }) And for...

UISpec4J tests in Eclipse are not found

java,eclipse,user-interface,testing,uispec4j

just for fun. you can remove "extends UISpecTestCase" in your class and give it a try see if it works or not :) Junit 4.X should support annotation well and I didn't see any reason you need to extends UISpecTestCase....

How to read a text from a page using Helium?

java,testing,automation,qa,helium

Solved the problem Text("My desire text").getValue(); This command is reading the string...

How to use Jasmine and CucumberJS with Protractor

angularjs,testing,jasmine,cucumber,protractor

CucumberJS and Jasmine are mutually exclusive; you won't be able to use Jasmine's expects in Cucumber steps. What you have to do instead is load a separate expectation module. I would suggest Chai with the chai-as-promised plugin. (chai-as-promised simplifies the process of writing expectations around promises. Protractor overrides the expect()...

Multiple behaviours for single entity

testing,process,entity,vhdl

This seems like an example where using multiple architectures of the same entity would help. You have a file along the lines of: entity TestBench end TestBench; architecture SimpleTest of TestBench is -- You might have a component declaration for the UUT here begin -- Test bench code here end...

Protractor synchrozation - timeout

javascript,angularjs,testing,protractor,end-to-end

You need to let protractor know that the login page is non-angular and it doesn't need to wait for angular to "settle down". Set the ignoreSynchronization to true before login and set it back to false after: describe('Login #1', function() { afterEach(function () { browser.ignoreSynchronization = false; }); it('should pass...

rails controller test failing non-deterministicly wrt state leak (I think)

ruby-on-rails,testing,controller,strong-parameters

Turns out I needed to call @subscription.reload.

'ProgrammingError' on django test case

django,unit-testing,testing,bdd,django-1.6

The problem was that test runner doesn't created database so that picture.save() method didn't alter database. So I just used os.remove(f) ...

How to use EqualsVerifier in a Spock test

testing,junit,spock,equalsverifier

It all works correctly but in spock it's a bit different, see: @Grab('org.spockframework:spock-core:0.7-groovy-2.0') @Grab('cglib:cglib-nodep:3.1') @Grab('nl.jqno.equalsverifier:equalsverifier:1.7.2') import spock.lang.* import nl.jqno.equalsverifier.* class Test extends Specification { def 'sample'() { when: EqualsVerifier.forClass(SomeClass).verify() then: noExceptionThrown() } } class SomeClass {} This spec fails since the exception is thrown - SomeClass needs to be corrected....

How to test Dart Polymer elements using the new Test library?

unit-testing,testing,dart,dart-polymer

The annotation @whenPolymerReady on main() is missing. Also the test transformer (explained in the README.md of the test package) should be added to the transformer section in pubspec.yaml.

How to test use of DI (NInject)

.net,testing,dependency-injection,ninject

I would create my own kernel and Load() the module(s) you are wanting to test. [TestMethod] public void TestThatWriterCrConnectorContainsConnector() { var kernel = new StandardKernel(); kernel.Load(new ModuleA(), new ModuleB()); var obj = kernel.Get<Writer>(); // ... assert } this is assuming you have defined all your bindings that you want to...

Authlogic: Functional Test Failing Validation

ruby-on-rails,ruby,testing,functional-testing,authlogic

Rick - you're a genius. I was missing :username as part of user_params in the controller. Thanks for the prompt.