My tests which turn green local, are getting red on travis. It's about this code:
And I change the year to "nineteen-ninenty-seven" # features/step_definitions/application_steps.rb:9
And I attempt to save the changes # features/step_definitions/application_steps.rb:17
Then I should see a message indicating that the data is invalid # features/step_definitions/application_steps.rb:26
expected to find text "Value must be of type integer." in "Provider configurations root name artist year" (RSpec::Expectations::ExpectationNotMetError)
./features/step_definitions/application_steps.rb:27:in `/^I should see a message indicating that the data is invalid$/'
features/editing_resources.feature:52:in `Then I should see a message indicating that the data is invalid'
This is in my support/capybara.rb
require 'capybara/cucumber'
require 'capybara/poltergeist'
Capybara.app = App.new
Capybara.javascript_driver = :poltergeist
Capybara.default_wait_time = 10
It's about this code:
When(/^I change the year to "(.*?)"$/) do |year|
find('input[name="root[year]"]').set year
end
When(/^I attempt to save the changes$/) do
find('input[type=submit]')
end
Then(/^I should see a message indicating that the data is invalid$/) do
expect(page).to have_content('Value must be of type integer.')
end
The problem:
When I run the tests local, they turn green. I debugged it there. I'm for sure that the code works well. The fields exist and get filled with the right data. When I use pry in my local tests on the point that I expect the message, I 'source' (or html), and I can find the text myself. On travis/ubuntu this doesn't work. I can confirm this doesn't work, cause I contacted Travis and they gave me a VM for a day where I duplicated the problem.
To solve it, I tried multiple things, I increased waiting time, tried selenium/webkit and selenium with chrome/firefox. They al work local, but I can't get them working properly on travis.
What I want to achieve is that the test validates if the user see's a messages which is getting created when a field isn't filled properly (text in integer field in this example).
The message is created by Json editor. https://github.com/jdorn/json-editor
And looks like this in code:
<small class="error">Value must be of type integer.</small>
A logic explanation in my opinion: in travis, the dom doesn't get the newest version which should load after an activity get's executed (like fill_in or set) and local this does work.
I hope somebody has an explanation and a solution.
Although I can't provide an answer for your exact problem, I can try to help you debug the issue with the information you provided.
Regarding Poltergeist:
Poltergeist allows you to take screenshots at specific points in your test
Depending on your tests, one thing that you may need is some fonts. If you're getting errors on a CI that don't occur during development then try taking some screenshots
I would try using page.save_screenshot before and after the points you identified and see what the differences are between local/travis.
EDIT: There is also a gem for capybara that takes screenshots whenever a test fails. Find more info here: Capybara-Screenshot
Related
I'm trying to run a script I've successfully run in the past, to create accounts. Expected result: script executes and accounts are created. Current result: script does not execute, instead gives a series of error messages that don't seem related to the content of the script (screenshot below).
The first few lines of the script are just comments, followed by imports and arg parsing (image below).
The CSV is properly formatted and the path to it is correct. As far as I know, nothing in the script has changed since the last time I ran it successfully. Scripting is not my strong suit, would deeply appreciate pointers.
Your script is missing a shebang. The first line of the file should be:
#!/usr/bin/env node
Last time you probably explicitly ran it with node scripts/etc/yourfile.js instead of just scripts/etc/yourfile.js, which would have hidden this problem.
We've created a report with Report Builder, published to the report server. Report 1, the primary report has 6 parameters; 3 multi-value params and 3 single value params. Would like Report 2 to open from Report 1 but in a separate window and pass all 6 parameters. In Report 2, they are also built as parameters. Parameters:
Neighborhood (multi)
Start (single)
End(single)
Source (multi)
Data_type(multi)
Prov_type(single)
In Report 1 we've created a text box with an action to open a javascript command. Here's the current call in Report 1 that opens another window but gives the generic error "not valid"
javascript:void(window.open('http://ourcompany/Reportserver/Pages/Report.aspx?%2fReports+in+Development%2funknown+provider+detail&rs:Command=Render&NEIGHBORHOOD="+join(Parameters!NEIGHBORHOOD.Value, "&NEIGHBORHOOD=")&"&SOURCE="+join(Parameters!SOURCE.Value,"&SOURCE=")&"&DATA_TYPE="+join(Parameters!DATA_TYPE.Value,"&DATA_TYPE=")&"&START="+Fields!START.Value+"&END="+Fields!END.Value+"&PROV_TYPE="+Fields!PROV_TYPE.Value+"'))
I've replaced "Fields" with "Parameters" and it still doesn't work. If I created it passing static fields it works as seen below;
javascript:void(window.open('http://ourcompany/Reportserver/Pages/Report.aspx?%2fReports+in+Development%2funknown+provider+detail&rs:Command=Render&rc:Parameters=true&NEIGHBORHOOD=Mesa&START=11/01/2016'))
Any thoughts? Thanks!
Part of the problem is that you are passing in the multi-value parameters multiple times. For example, part of your expression would result in:
...&SOURCE=A&SOURCE=B&SOURCE=C...
You can only set one value per parameter in the URL.
So the solution to that would be to comma separate the values and pass them in as a single string. Then, in the subreport, you would need to parse them out again.
"&SOURCE=" & join(Parameters!SOURCE.Value,",")
You may run into additional issues such as URL length limitations, but this will fix the immediate problem.
Ok, so I've worked out the syntax and believe that is working. I took out a few extra ampersands I had in there. Here's the code working:
javascript:void(window.open('http://ourcompany/Reportserver/Pages/Report.aspx?%2fReports+in+Development%2funknown+provider+detail&rs:Command=Render&NEIGHBORHOOD="+join(Parameters!NEIGHBORHOOD.Value, ",")"&SOURCE="+join(Parameters!SOURCE.Value,",")"&DATA_TYPE="+join(Parameters!DATA_TYPE.Value,",")"&START="+Parameters!START.Value+"&END="+Parameters!END.Value+"&PROV_TYPE="+Parameters!PROV_TYPE.Value+"'))
However, I have an entirely different issue now. Looks like an SSRS bug. I get the error, "report parameter 'START' is not valid for its type. (rsReportParameterTypeMismatch)" In both reports they are date/time values. I've done all the tricks by changing the system datetime formats to no avail. Any thoughts on this one? Thanks
I am writing a Selenium script to test a Chrome app that uses the Chrome.fileSystem.chooseEntry API to select a directory. When I do this manually, it works fine. But when I do this in a Selenium script, I get back this error:
Unchecked runtime.lastError while running fileSystem.chooseEntry: Invalid calling page. This function can't be called from a background page.
Any ideas on how to make Selenium and chooseEntry play nicely together?
I updated to the latest Chromedriver, but still no luck. I also looked at ChromeOptions, but didn't see anything that looked like it would be helpful. The interwebs doesn't seem to have much to say about Selenium and chooseEntry. I'm on version 51 of Chrome.
I'm down to thinking I'll need a special javascript entry point to set the path values for testing instead of using chooseEntry. But I would strongly prefer to not have a separate code execution path for my tests. Anybody have a cleaner solution?
EDIT: per commenter's request, here's the offending code:
chrome.fileSystem.chooseEntry({type:'openDirectory'},function(entry) {
chrome.fileSystem.getWritableEntry(entry,function(writeable_entry) {
console.log("got writeable entry");
});
}, function(e) { errorHandler(e); });
EDIT #2: I've gone with the special javascript entry point hack. In manual mode -- i.e., not running under Selenium -- I run code that executes chooseEntry, and then use the retainEntry API to get the entry id. I added an entry point in my javascript to take an entry id and call the restoreEntry API to turn it back into an entry. I also modified my code so if this entry object is set, then use that as the file instead of calling chooseEntry. Lastly, I modified my Selenium script to call the restoreEntry entry point before running the rest of the script.
This is not ideal, since now my test code execution path is somewhat different from my actual live-human-being-at-the-controls code execution path. But at least it lets me use Selenium scripts now. Of course, if anyone can think of a non-horrible way to solve this solution, I'd love to hear about it.
EDIT #3: Per #Xan's comment, corrected my terminology from "extension" to "Chrome App."
I can only offer this horrible hack. For Chrome Apps under OSX I created folder favorites and use Robot keyPress to navigate and select the 'favorite' folders needed for the App. The only possible redeeming factor is that it does mirror a valid/possible actual human interaction with the file interface.
private void selectOSXFolderFavorite(int favorite) {
// With an OSX file folder dialog open, Shift-Tab to favorites list
robot.keyPress(KeyEvent.VK_SHIFT);
robot.keyPress(KeyEvent.VK_TAB);
robot.keyRelease(KeyEvent.VK_TAB);
robot.keyRelease(KeyEvent.VK_SHIFT);
// move to the top of favorites list
int i = 40;
while (i-- > 0) {
robot.keyPress(KeyEvent.VK_UP);
robot.keyRelease(KeyEvent.VK_UP);
}
while (favorite-- > 0) {
robot.keyPress(KeyEvent.VK_DOWN);
robot.keyRelease(KeyEvent.VK_DOWN);
}
// Send an enter key to Select the selected folder
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER);
}
I am new using cloud code of parse.com
I am trying to debug my cloud code, but I can not read the console.log in the terminal. I am using the console of my Mac in this way:
parse deploy
Once the code has update successfully, I curl -X POST the code of the app (the function I want to test) but I can only read the response.success() or the response.error(), all the console.log that I have in the code doesn't appear in the console.
I assume that the log output should appear in the console, but it doesn't.
note for anyone reading, Parse.com is closing down later in 2016 - so don't get too invested in it :O
consider say back4app.com
If you're reading this in the far future .. Parse.com was an ingenious BAAS which ran for a couple years, sensibly sold out to Facebook, and then FB gave up after a couple years. It was basically free to use, so the whole fiasco maybe marks the end of the "amazing stuff, totally free to developers" era.
In your Terminal it's
] parse logs
to see the last few logs.
or if you want to watch everything continuously from the cloud,
they have a command which pipes that output continuously to your terminal:
] parse develop "Your App Name"
So as you, or indeed normal users of your app, uses the Parse app, you can watch "everything that is happening".
(Note too that, once you "turn on" the "parse develop" mode: as well as printing out everything that is happening on the server, additionally: if you locally edit the text files (main.js and so on) in fact, it goes ahead and uploads them to the server, that is to say, just as if you had done a "parse deploy".)
This is a good question -- it's really quite astounding that this is so badly explained everywhere, since, Parse is completely unusable unless you know about these two commands!!
I have a Crystal Report that redirects to another application URL and includes get variables in the link. For some reason those variables disappear when the page loads in the second application, and I'm not sure why.
When I view the source of the Crystal Report output, here is an example link:
GLASS BLOWING SHOP
When I plug this into an html decoder to make sure it's correct, I get this result:
javascript:parent.bobj.event.publish('hyperlinkClicked','CrystalReportViewer1__UI','target=_self&url=/intranet/API_PriceInc_Ltr/Start.aspx?slmno=ZZZ&cusno=7597&venno=50065&cutoff=08/01/2013&increase=.01&shipaddr=773&effective=08/05/2013&slmname=XXXX')
The above string works perfectly when I plug it into the web page URL bar manually(adding the server IP, of course.) However, when I click on the link from the Crystal Report, I get this instead:
http://SERVER-IP/intranet/API_PriceInc_Ltr/Start.aspx?slmno
For some reason everything after the name of the first variable gets cut off. Any suggestions as to why?
Same problem here, upgrading from Crystal Report 9 to 13 and .NET 1.1 to 4.0.
My link is build by a format formula (format editor, tab "hyperlink").
Solution: I had to change something in the formula and save ist again.
You don't need to change something specific. Add a blank or anything. Just re-save the formula with the Crystal Report 13 editor.
Possible you first have to upgrade your Crystal Report to the newest servicepack, like mentioned in the links from Ben's answer. Not sure because I found the solution with re-saving after I upgraded.
Turns out this is a known bug that was documented ~3 years ago on the SAP webpage. Their support said it was resolved with an update, the poster came back stating that the issue was still present, and then there was never another response.
Here is the initial thread documenting the issue: http://scn.sap.com/message/9553393
Here is my thread bringing the issue back up (hopefully to resolution): http://scn.sap.com/thread/3416821