w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Cucumber not finding step definitions
Similar to my question:Cucumber Test acting in a strange way You can implement step definitions for undefined steps with these snippets: When(/^I am on the structure page$/) do pending # express the regexp above with the code you wish you had end As the error saying. Put the code above in web_steps.rb and then replace pending # express the regexp above with the code you wish you had with the code you want

Categories : Ruby On Rails

Cucumber devise sign in step failing (rails 3.2, cucumber, capybara, rspec)
You need to create the user in the database first. User.create(name: "Testy McUserton", email: "example@example.com", password: "please", :password_confirmation: "please"). Then you can login with the credentials. You can also use factorygirl link

Categories : Ruby On Rails

Cucumber step definition
There are several possibilities: Check page's path/url using current_path or current_url methods: Then(/^I should go to the dashboard page$/) do current_path.should == expected_path # or current_path.should == expected_url end Check contents of the page using one of RSpec matchers Then(/^I should go to the dashboard page$/) do page.should have_css('#id_that_is_present_only_at_dashboard_page') end Also you may use page object pattern and do something like: current_path.should == DashboardPage.path

Categories : Ruby On Rails

Should I unit test my Behat step definitions?
I would try to test any logic used within generic test code. E.g. I wrote a special assert function for phpunit I used in many tests (asserting that two string are equal while ignoring any whitespace differences). I unit tested (actually even TDDed) this logic all the way.

Categories : PHP

Get all items inside quotes in Cucumber Step Definition
This seems like a good place to use the #And alias. Given I attach dog.png And I attach cat.png And I attach alphabet.doc ... Alternatively you can use data tables for easy multiline arguments

Categories : Ruby

Pull scenario outline (or read a tag) from within cucumber step
You cannot access that information directly from within a step definition. If you need the information, you will have to capture it during a before hook. The following before hook will capture the feature name, scenario/outline name and the list of tags: Before do |scenario| # Feature name case scenario when Cucumber::Ast::Scenario @feature_name = scenario.feature.name when Cucumber::Ast::OutlineTable::ExampleRow @feature_name = scenario.scenario_outline.feature.name end # Scenario name case scenario when Cucumber::Ast::Scenario @scenario_name = scenario.name when Cucumber::Ast::OutlineTable::ExampleRow @scenario_name = scenario.scenario_outline.name end # Tags (as an array) @scenario_tags = scenario.source_tag_names end As an

Categories : Ruby

Modifying a cucumber step definition to give more useful output
can you not call fail on the scenario? see: how to force a cucumber scenario to fail?

Categories : Ruby

Step by step procedure to create webservice in spring
in detail explanation http://static.springsource.org/spring-ws/sites/2.0/reference/html/index.html step by step example http://krams915.blogspot.in/2010/12/spring-ws-tutorial-using-latest-200-rc2.html

Categories : Web Services

Finding specific div element just below span with title text in cucumber
You want to do: title = "Title 2" within( find(:xpath, "//span[normalize-space(text())='#{title}']/following-sibling::div[1]") ) do click_link 'publish' end An explanation of the xpath: //span[normalize-space(text())='#{title}'] looks for the span with the title. Note that normalize-space(text()) is used to make handling of spaces easier by removing extra spaces. This allows specifying the title as "Title 2" instead of having to do " Title 2 " (ie having to specify the leading/trailing space). /following-sibling::div[1] says that from the span found, find the first div element that follows.

Categories : CSS

How to direct to the user update route "put user_path" on cucumber (Rails/cucumber/rspec)
Our routes will probably contain line like this: PATCH/PUT /user/:id update update a specific user And didn't specify the id of object you want to update. When /^I submit to the update action$/ do put user_path(user) end See more details in this question.

Categories : Ruby On Rails

The Python assignment operator, function definitions, and variable definitions
edit: a class solves all of this very easily, and much more cleanly. Having a separate variable for each zone, etc. makes everything a lot smoother. Thanks for the help, though guys. Much appreciated.

Categories : Python

Spring job fails on step Exception but I don't want it to
Well in my case I was getting an error when I tried to modify the step like so: <step id="eodStep01PrintChartOfAccountsReport" next="eodStep02Decider"> <tasklet ref="printChartOfAccountsReportTasklet"/> <next on="*" to="eodStep02Decider" /> </step> and I couldn't figure out why. Upon closer inspection and reflection I realized the next="eodStep02Decider" was what was causing me problems. Once I removed it then it let me put the next="on" in the step and all is well. Sorry to waste anyone's time on this. Hopefully someone else in the future finds this and it helps them.

Categories : Spring

Spring Social Twitter Auth in one step
There is no way to get user email using Twitter API. You need to ask user to give his email in your application directly. You can try to simplify OAuth2 dance using implicit flow feature. See these links for more details: OAuth2: the Implicit Flow, aka as the Client-Side Flow Google Accounts: Using OAuth 2.0 for Client-side Applications But I am not sure that you can do it without any redirect at all. From Google link it looks like you have redirect in popup option. Hope it helps.

Categories : Misc

Deciding between Spring Batch Step, Tasklet or Chunks
Spring Batch is the perfect tool to do what you need. The chunk oriented step let you configure how many items you want to read/process/write with the commit-interval property. <batch:step id="step1" next="step2"> <batch:tasklet transaction-manager="transactionManager" start-limit="100"> <batch:chunk reader="myReader" processor="myProcessor" writer="MyWriter" commit-interval="800" /> <batch:listeners> <batch:listener ref="myListener" /> </batch:listeners> </batch:tasklet> </batch:step> Let say your reader will call a SELECT statement that returns 10 000 records. And you set a commit-interval=500. MyReader will call the read() method 500 times. Let say that

Categories : Spring

Step by step guide to train a multilayer perceptron for the XOR case in Weka?
Using learning rate with 0.5 does the job with 500 iterations for the both examples. The learning rate is how much weight it gives for new examples. Apparently the problem is difficult and it is easy to get in local minima with the 2 hidden layers. If you use a low learning rate with a high iteration number the learning process will be more conservative and more likely to high a good minimum.

Categories : Machine Learning

How to start doing highcharts spline updating each seconds? Step by step guide please
Please consider this example http://www.highcharts.com/demo/dynamic-update. Only what you need is print in php and then in javascript get correct value from json (instead of using Math.rand()). Then you can avoid of using ajax.

Categories : PHP

Magento step by step selecting color,size, and grouped products
This can be done through configurable products. Step 1- Create different products for each size and color. Step 2- Create one configurable product, and associate the above created products into it. Here is tutoral how to create configurable product. http://www.magentocommerce.com/knowledge-base/entry/tutorial-creating-a-configurable-product Just posted the same answer to your previous question. This is the simple and best way to do this.

Categories : Magento

html/jquery multiple step form - go to next step depending on which radio button was selected
Try this on click of simple button var val = $('input:radio[name=path]:checked').val(); switch (val ) { case 'school': $('#step1-1').show(); break; case 'home': $('#step1-2').show(); break; case 'friends': $('#step1-3').show(); break; case 'activities': $('#step1-4').show(); break; case 'health': $('#step1-5').show(); break; default: }

Categories : Jquery

Step for step tutorial for setting simple animation when deleting/inserting rows in listview
http://karnshah8890.blogspot.com/2013/04/listview-animation-tutorial.html That gives a pretty good way to do it. All you have to include is logic that only fires the animations when an item is added or deleted. That shouldn't be too difficult.

Categories : Android

Is there more overhead to code in a single statement then to break it down step by step?
They will effectively produce the same code, performance-wise. From a maintainability and debugging standpoint, option #1 is much preferred as it allows for easier injection of break points via Visual Studio and it is generally easier to understand as the amount of logic in each line is smaller. I would actually advocate a happy-medium between the two options, call it Option #1.5: Dim html As String = WebBrowser.DocumentText Dim htmlString As String = "size=" & Chr(34) & "15" & Chr(34) & " maxlength=" & Chr(34) & "40" & Chr(34) & ">" Dim dIndex As Integer = html.IndexOf(htmlString) If (dIndex > -1) Then Dim lIndex As Integer = sDomain.IndexOf("<") Dim sDomain As String = html.Substring(dIndex + 26, 20) LblSubDomain.Text = sDomain.S

Categories : Vb.Net

Step By Step Process for creating and distributing Mac App for beta testing
As it turns out Beta testing does not use the production provisioning profile, it just uses the same development provisioning profile which has to be loaded onto the test device (if its a Mac). My mistake thinking the production profile was used.

Categories : Xcode

Step by step: Installing Python 3.3, Lighttpd & Pymongo on Ubuntu 12.04
It's easiest to use the Ubuntu repositories: sudo apt-get update sudo apt-get install python3 python3-pip lightppd python-pymongo Or if that only installs the python2.x pymongo, use pip, which you've just installed: sudo pip-3.3 install pymongo Or better yet, use a virtualenv with the help of virtualenvwrapper (docs) sudo pip install virtualenvwrapper ... # follow instructions for installing virtualenvwrapper mkvirtualenv --python=/usr/bin/python3 -i pymongo mongoppd workon mongoppd ... which will segregate the environment I've called 'mongoppd' from the rest of your system so you can't cause any trouble. Then you don't need sudo to pip-3.3 install things, just workon mongoppd then pip-3.3 install [...]. Or after the -i flag when you create the virtualenv to get it installed strai

Categories : Python

How to build a layered plot step by step using grid in knitr?
You could use grid.grab() to capture the scene at the end of a chunk, draw it in the new chunk, and navigate to the last viewport (needs to be named). Unfortunately, knitr thinks grid.grab() should result in a new plot, I'm not sure how to fix that. ```{r first, tidy = FALSE} library(grid) grid.newpage() ## draw a rectangle around the root vp and provide some text grid.rect() grid.text("this is the root vp", x = 0.5, y = 1, just = c("centre", "top")) vp <- viewport(x = 0.5, y = 0.5, height = 0.5, width = 0.5, just = c("centre", "centre"), name="first") pushViewport(vp) grid.rect(gp = gpar(fill = "pink")) grid.text("this is our first vp", x = 0.5, y = 1, just = c("centre", "top")) scene <- grid.grab() ``` ```{r second, tidy = FALSE,

Categories : R

Implementing 'successful git branching model' step by step
1) You can choose whichever branch you want to develop on - it can either be master or develop. I would recommend trunk/master -branch-based development (in which case, I would suggest to delete the develop branch itself). 2) Users will have to setup their version of master to track your repo (in this case, git can act just like any other non-dvcs SCMs - ie having a central repo where every committer pushes to/pulls from). By setting this following/tracking, then they can push to their "remote". 3) Same as above, they can pull/push from the remote/central repo. 4) If you are following a Continuous Delivery/Deployment model, you dont need feature/release branches. If not, then I would suggest a branch for each release. Feature-branches can be done, but preferrably should be short-lived.

Categories : GIT

WPF ListBox item load step-by-step animation
The suggested Slide Animation is a view animation. I think you want a data animation. Bind to an alternate view only collection. Populate this collection one at a time from the backing collection with the aid of a timer. A quick search reveals that a Dispatch Timer seems to be preferred with WPF usage.

Categories : Wpf

Step by Step procedures in using ActionBar Support API on Android 2.1
You need to add the support lib from your Android SDK folder. See this post.

Categories : Android

How to quicksort this data (step by step) with my own chosen pivot
You wouldn't swap corresponding numbers if the left is greater than the right, you would swap them depending on how they compare to the pivot value. 7 is greater than the pivot value already, so it's already on the correct (right) side of the pivot. However, the standard algorithm for in-place partitioning is fairly different from what you seem to be attempting. Take a look at the Wikipedia article for in-place Quicksort.

Categories : Algorithm

Symfony2 file upload step by step
Do you know now what are the 'important' function to add to be able to upload the photo and rename it? See the official documentation on how to do this. There are good working examples for a simple file upload. Also check the doctrine documentation for lifecycle callbacks. How do you check the extension to see if the upload is possible? There is some HTML-Form validation in each browser. See this question for the HTML accept="" attribute in input elements. Also in Symfony2 you can specify the MIME-type of an uploaded file using this annotation: /** * @AssertFile( * maxSize = "1024k", * mimeTypes = {"application/pdf", "application/x-pdf"}, * mimeTypesMessage = "Please upload a valid PDF" * ) */ Even though you did not want to use any bundles I'll have to rec

Categories : File

Difference between "step" and "step in" in the MATLAB debugger
When you use step in on a function call, you will enter said function. step is used to move to the next line. When you use them on lines without function calls, they are equivalent.

Categories : Matlab

JBPM AND MYSQL INTEGRATION STEP BY STEP
What you are looking for is this: Set up jBPM 5.4 Final Installer to use MySQL if you are new to jbpm, i highly recommend being active in jboss community. That helps a lot.

Categories : Mysql

Looking for step-by-step guide about "HTTP to HTTPS"
First of all you need to create an SSL certificate. There are lots of sites out there that do it http://www.selfsignedcertificate.com/ or http://www.godaddy.com. Once you have a certificate you need to install it on your web server. Depending on Windows or other OS you will do this differently. Lastly you will configure you website to use https (port 443) rather than http (port 80). This is configured with IIS or Apache directly. Hopefully this link for windows and this for Apache helps a bit too. If you are using another hosting application, just Google: install ssl certificate [myhostingApplication] Update: For shared hosting this will more than likely depend on your hosting provider. If you don't have access to IIS or similar, you more than likely will have to contact your provide

Categories : Ssl

A code for step by step JPEG compression
where can I find a code for each individual step If a C library might be a candidate for you, you should have a look at jpec a lightweight JPEG encoder written in C - note that it only supports grayscale images. The main encoding function (jpec_enc_run) is easy to read and provides each above step via internal functions: /* open = write JPEG headers */ jpec_enc_open(e); while (jpec_enc_next_block(e)) { /* compute the DCT for the current 8x8 block */ jpec_enc_block_dct(e); /* quantize the DCT coefficients for the current block */ jpec_enc_block_quant(e); /* re-order the quantized coefficients with the zig-zag pattern */ jpec_enc_block_zz(e); /* perform entropy coding of the current block and write to the global buffer*/ e->hskel->encode_block(e->hskel->

Categories : Image

Can I process an unrealized lazy-seq step by step
Clojure's lazy sequences are often chunked. You can see the chunking at work in your example if you take large sizes (it will be helpful to reduce the thread sleep time in this case). See also these related SO posts. Though for seems to be chunked, the following is not and works as desired: (defn gen-lazy-seq [size] (take size (repeatedly #(do (Thread/sleep 1000) (rand-int 10))))) (doseq [item (gen-lazy-seq 10)] (println item)) "I have messages coming in over a network, and I want to start processing them before all have been received." Chunked or no, this should actually be the case if you process them lazily.

Categories : Clojure

Construct clause step by step
I'd attack the problem with DCGs. sentence(S) --> color_statement(S) ; on_statement(S). det --> [a]. det --> [the]. color_statement(color(Noun, Color)) --> det, [Noun], [is], color(Color). color(Color) --> [Color], { color(Color) }. color(red). color(blue). on_statement(on(Noun, Place)) --> det, [Noun], [is,on], det, [Place]. This is assuming you have some kind of tokenization in place, but for demo purposes, you'll find this "works": ?- phrase(sentence(S), [the,pen,is,on,the,bookshelf]). S = on(pen, bookshelf). You will no doubt need to extend these rules for your purposes. You can find tokenization stuff by searching, and only you know exactly the kinds of nouns and modifiers you want to support, so this is really just a sketch of how this could proceed. Fr

Categories : Prolog

Breaking up the following calculation step by step C++
in c++ >> means shift right the code for int dat = (125*val)>>8 ; would be: int dat = 125 * val; for(int i = 0; i < 8; i++) { dat = dat / 2; }

Categories : C

How exactly (step-by-step) to clone my git project
It's saying that it can not find the repository you specified. There really isn't a step by step for cloning, because cloning is just a single command git clone urlToProjectYouWantToClone Consider reading some guides like this

Categories : GIT

Android Proguard - step by step
One of your libraries contains copies of org.xmlpull.v1 classes, even though those are already present in the Android runtime. You should remove those classes from the libraries. The versions in the Android runtime would get precedence anyway. Cfr. ProGuard manual > Troubleshooting > Warning: library class ... depends on program class ...

Categories : Java

Spring session factory not finding mapping files in multiple directories with same class path
You are using maven. And since you put your Bar mapping into the test resource directory, it is only available when running tests. I assume you have a persistence-unit configured similar to the example below <persistence-unit ...> <class>something.Foo</class> <class>something.Bar</class> </persistence-unit> What happens at start-up is that Spring starts Hibernate, hibernates reads the persistence-unit and asks the factory for the mappings. But remember, Bar is only a test class. So Spring finds the mappings from src/main/resources, but since it does not run as a test, it does not see src/test/resources.

Categories : Spring

Payment using credit card through balanced payment in rails step by step
The steps would depend on what type of application you're trying to develop. The basis of the system is that you create a Customer for each of your users. balanced.js removes the need for you to be PCI compliant because the sensitive data is submitted directly to Balanced and never goes through your servers. You use balanced.js to tokenize credit cards and bank accounts and add them to specific Customer instances. Once you've got the cards and bank accounts added you can do things like debit customerBuyerA and credit customerSellerB. Next, I encourage you to read through some of the common fee scenarios to get an idea of what's going to work well for your business. https://docs.balancedpayments.com/current/#collecting-your-fees Both https://docs.balancedpayments.com/current/overview.htm

Categories : Ruby On Rails

validation step by step
You could do it though checking on submission of the form and posting back to a literal with error messages. Postback validation is better than just relying on javascript in any case. So, depending on the level of checks you want to employ, you could do something like: protected void btnSubmit_Click(object sender, eventArgs e) { if(String.IsNullOrEmpty(txtBox1.Text)) { ltError.Text = "Sorry, error message for box1"; return; } } Obviously you'd work in more checks and after passing stage1 you'd move on to stage 2. Not great from a user experience but would work.

Categories : Asp Net



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.