Flutter integrtaion_test: How to integration_test hyperlink? - dart

I am developing some intregration tests for my flutter-web application. wherein i wanted to automate the hyperlink. So is there a way to test the hyperlink or some tab switching mechanism possible in integration_test?

Yes, there is a way to achieve this, you can refer the url_launcher's integration_test package on GitHub. It has an elaborative example on testing for web and it covers both of your use cases.
https://github.com/flutter/plugins/blob/master/packages/url_launcher/url_launcher_web/example/integration_test/url_launcher_web_test.dart

Related

Is it possible and advisable to use Antora's UI customization to generate a Google Sheets-like help widget?

I would like to use Antora to create a Google Sheet-like widget on a web app written in React. I wanted to see if the recommended approach is to write this in React or to utilize Antora's UI customization capabilities.
I have not tried to prototype either of these approaches yet.
Antora is a static site generator (SSG), so that's overkill for your use case and would add unnecessary complexity.
Antora documentation is authored in Asciidoc. Instead of using Antora, you can use asciidoctor to transform Asciidoc->HTML. There is asciidoctor.js, which is transpiled from the asciidoctor Ruby source, and that would be a good fit for a React app.

Fitnesse: is it possible to disable Test and Suite buttons?

I am running Fitnesse on several dispathers and then copy Fitnesse history and logs from all dispatchers to a separate machine. Some other project members need access to test results on this machine but I don't want them to be able to click Test or Suite there. Is it somehow possible to disable Test and Suite buttons?
I would be glad for any options: either somehow configure it in Fitnesse, or get a patched fitnesse.jar, or any other options.
On the main Fitnesse site (http://fitnesse.org/StayInformed), there is the following note: "Note, the Test and Suite buttons on this site have been disabled because search engines tend to invoke them and put my server under stress. This site is actually created with FitNesse.". So I need something like that, if possible.
Is it possible? Not sure I can find a corresponding place in source code to patch and re-build it. My hope is whether someone already did it or find it easy to help. I raised an issue in GitHub where Fitnesse source code is located but I didn't get any feedback yet.
Thank you!
It is indeed possible, that is indeed what is done for fitnesse.org.
I'm not 100% sure how its done but I suspect it is done by disabling 'responders', see http://fitnesse.org/FitNesse.UserGuide.AdministeringFitNesse.ConfigurationFile.
In that page a description is given to disable creating new pages:
Responders=addChild:fitnesse.responders.DisabledResponder,new:org.fitnesse.responders.DisabledResponder
You can probably also use this to disable SuiteResponder and TestResponder, by using:
Responders=suite:fitnesse.responders.DisabledResponder,test:org.fitnesse.responders.DisabledResponder
The full list of responders is in fitnesse.responders.ResponderFactory
On a side note: why do need a full FitNesse installation to show test results? I recommend you look into generating tests results in html format, and just publish that html somewhere. I usually use the jUnit runner to run the tests on a build server (it also creates html output) and then publish the html files generated as build artefact which people can open/view.
Sample, from FitNesse project, generating html in build/fitnesse-results:
import org.junit.runner.RunWith;
#RunWith(FitNesseRunner.class)
#FitNesseRunner.Suite("FitNesse.SuiteAcceptanceTests.SuiteSlimTests.TestScriptTable")
#FitNesseRunner.FitnesseDir(".")
#FitNesseRunner.OutputDir("./build/fitnesse-results")
public class FitNesseRunnerTest {
}

Testing Web Apps Using DRT

I'm trying to use DRT for running acceptance tests.
Because it's an acceptance test I need to change the location to open the page under test. But of course, after I've done it my test script is gone.
I tried to use iFrames as a workaround, but Dart doesn't provide any means of getting the content of an iFrame. Which means that it's possible to load the page under test into an iframe, but it's impossible to get its html.
I've checked all the DRT tests in the Dart repo:
http://code.google.com/p/dart/source/browse/#svn%2Fbranches%2Fbleeding_edge%2Fdart%2Ftests%2Fhtml
but it seems that none of them changes the location.
Is it possible to use DRT for running acceptance tests? Is there a workaround I didn't think of?
We haven't come up with a good trick (redirection or iframes) to load the app as it is written and runs the test code on top of it. Instead, you could copy the entrypoint of an app and include the test code there, then run the modified app directly in DRT.
Here is an example from the web-ui codebase of a test that does this. This test runs the TodoMVC app and interacts with it:
https://github.com/dart-lang/web-ui/blob/master/test/data/input/todomvc_listorder_test.html
All we did is copy the original app's html, add the 'testing.js' script tag, and replace the dart script tag with the test code. It might be possible to create a script that automates what we do manually today, but we haven't done that.

Rails how to automatic check if a link is broken?

How is it possible to automatic check if a link is broken?
What is the best solution (Screenscraping or other)
You could try selenium which is an automated testing framework.
You could also try monit which is a monitoring application (daemon). Sometimes I just use that service to check if a particular website or link is up. You can set it to check periodically.

Resumable Upload in Ruby on Rails

I am looking for a resumable-file-upload component to use in my RoR app. I found one: http://github.com/taf2/resume-up/tree/master (built in native Ruby, but it requires google gears which is a discontinued product now..)
Also, http://github.com/dassi/mediaclue is another app in which they have used jumploader java applet. more on it: jumploader.come
Is there a way to achieve this functionality without using java-applet?
Try this: http://upload.thinfile.com/upload/thin.php - its quite cheap and you can try the demo for free. You'll need to build a controller.

Resources