yanne / api-testing

I am using this to test GitHub API
1 stars 0 forks source link

Support for Seleniumlibrary and other external libs #301

Open yanne opened 10 years ago

yanne commented 10 years ago

None

This issue was originally opened at Google Code on Mar 17, 2011.

yanne commented 10 years ago

Original comment by dietrich...@googlemail.com on Mar 17, 2011.

There is a similar issue here, but it is a general problem: How to get needed libraries during a maven build:

https://code.google.com/p/robotframework-seleniumlibrary/issues/detail?id=132

Can we use easy_install somehow.

yanne commented 10 years ago

Original comment by dietrich...@googlemail.com on Mar 17, 2011.

Or maybe -XBootclasspath? See https://code.google.com/p/robotframework/wiki/JavaIntegration#Using_additional_Java_libraries

yanne commented 10 years ago

Original comment by dietrich...@googlemail.com on Mar 17, 2011.

How about --pythonpath support?

I've managed to package the seleniumlibrary with rf, following the description by Laurent Carbonneaux https://code.google.com/p/robotframework-seleniumlibrary/issues/detail?id=132#c6 , now I can call the selenium tests with server startup and shutdown like this:

\src\test\resources>java -cp robotframework-selenium-2.5.6.jar org.robotframework.RobotFramework

For this setup, selenium-server.jar has to be in resources/lib, but need not be in the rf+selenium jar (although Laurent says you should only add the py files, he lists the selenium-server.jar as content file of the combined rf+sel jar, which seems not to work)

So far so good, however, what about other libs? I wonder if the rf commandline option -P might be helpful and why it is not supported by the jybot goal. Are there any known issues with the --pythonPath option?

yanne commented 10 years ago

Original comment by eero.hel...@gmail.com on Mar 19, 2011.

Having Selenium library included in this plugin would be absolutely fantastic.

I tried bundling Selenium Library into the Maven plugin using Mr Carbonneaux’s instructions and it seemed to work perfectly, so that works as an intermediate solution. Of course, it’d be even better if Selenium library were included in the standard distribution of the plugin.

As far as I can see, the Selenium server doesn’t necessarily need to be included, either, because you can use the Selenium Maven Plugin ( http://mojo.codehaus.org/selenium-maven-plugin/ ) to start the server in the pre-integration-test phase, run your Robot test cases in the integration-test phase, and stop the server in post-integration-test phase.

Either way, many thanks for creating the plugin; I’m already finding it extremely useful!

yanne commented 10 years ago

Original comment by mrmall...@gmail.com on Mar 20, 2011.

didn't put python path flag as I haven't personally tested it. will check it out if it works. otherwise, i'll try to put a hook somewhere so that other libraries could be used.

i'm targeting 1.1 release within the week. hopefully this should make it

yanne commented 10 years ago

Original comment by mrmall...@gmail.com on Mar 20, 2011.

I created some instructions to make this work on trunk version:

https://code.google.com/p/robotframework-maven-plugin/wiki/UseWithSeleniumLibrary

If someone can verify that this works for them, I'll considering releaseing this ASAP.

yanne commented 10 years ago

Original comment by eero.hel...@gmail.com on Mar 21, 2011.

I tried it, but it didn't work for me: there seems to be something wrong with the variableFile property. It worked for me in 1.0.1, but 1.1-SNAPSHOT isn't reading the file defined in the variableFile property at all: it complains about unrecognized variables. I didn't change any of the settings related to that, either.

When I reverted to 1.0.1 (and my custom version of the plugin that includes Selenium library), the variableFile property started working again.

yanne commented 10 years ago

Original comment by mrmall...@gmail.com on Mar 21, 2011.

oops sorry, variableFile is now variableFiles in 1.1-SNAPSHOT in order to accommodate maven convention:

filehere
yanne commented 10 years ago

Original comment by mrmall...@gmail.com on Mar 21, 2011.

btw, all parameters that are Lists are now pluralized except for:

metadata critical nonCritical tagStatCombine

yanne commented 10 years ago

Original comment by eero.hel...@gmail.com on Mar 21, 2011.

All right, I switched to the correct variableFiles element syntax, and from what I can tell, everything seems to be working perfectly. Thanks!

yanne commented 10 years ago

Original comment by mrmall...@gmail.com on Mar 22, 2011.

awesome. thanx! i've been doing some testing as well and seems to be doing fine. will probably do a release within the week once i'm confident

yanne commented 10 years ago

Original comment by dietrich...@googlemail.com on Mar 22, 2011.

It works for me as well. I tried with Franz See's DatabaseLibrary combined with JayDeBeApi and the Oracle Driver. If you need to add jar dependencies, you can do it by adding it as dependency to the robotframework plugin. Simple!

I tested the libdoc goal, too. It works as designed.

From my point of view, please release as soon as you can.

Can we bump up the rf version to robotframework 2.5.6?

Concerning libdoc: it is a bit difficult to use if you keep resources and tests in the same folder, which seems to be a common practice. Libdoc cannot handle test cases, only resources. A future improvement might be to have a fileset with includes and excludes which runs against the default tests folder. I'll write an issue for that and see if I can come up with something.

yanne commented 10 years ago

Original comment by m...@orangeandbronze.com on Mar 23, 2011.

thanx!

when you say add dependency, did you mean something like this:

 <plugin>
    <groupId>com.googlecode</groupId>
    <artifactId>robotframework-maven-plugin</artifactId>
    <version>1.1-SNAPSHOT</version>
    <executions>
      <execution>
        <goals>
          <goal>run</goal>
        </goals>
      </execution>
    </executions>
    <dependencies>
      <dependency>
        <groupId>group</groupId>
        <artifactId>artifact</artifactId>
        <version>1</version>
      </dependency>
    </dependencies>
  </plugin>

yup i'm planning on upgrading it to 2.5.6. if the maven central repo still doesn't host it, might as well provide a make shift version here.

these are actually stuff i want to be part of 1.1. as well as the libdoc issue you mentioned above. i already have some idea. i'll file an issue. please comment there.

yanne commented 10 years ago

Original comment by mrmall...@gmail.com on Mar 23, 2011.

ticket here:

https://code.google.com/p/robotframework-maven-plugin/issues/detail?id=5

yanne commented 10 years ago

Original comment by dietrich...@googlemail.com on Mar 23, 2011.

Precisely. Here is my classpath dependency extension which allows to use the oracle driver with jaydebeapi and Python DatabaseLibrary:

com.googlecode robotframework-maven-plugin 1.1-SNAPSHOT integration-test run com.oracle ojdbc14 test 10.2.0.3.0