GithubHelp home page GithubHelp logo

kennychua / phantomjs-qunit-runner Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 268 KB

Automatically exported from code.google.com/p/phantomjs-qunit-runner

Java 21.99% JavaScript 69.26% CSS 6.88% HTML 1.86%

phantomjs-qunit-runner's People

Contributors

kennychua avatar kerumai avatar spazkus avatar

Watchers

 avatar

phantomjs-qunit-runner's Issues

Need to clarify Configuration Paths

I just wanted to clarify that you don't want to put in the "../" and "/.." in 
your paths. And if you don't have phantomjs on your path, you need to point to 
the actual executable, not the directory holding. I found this to be quite 
confusing and would recommend making clarifications in the project 
documentation.

            <plugin>
                <groupId>net.kennychua</groupId>
                <artifactId>phantomjs-qunit-runner</artifactId>
                <configuration>
                    <jsSourceDirectory>web-app/js</jsSourceDirectory>
                    <jsTestDirectory>test/js</jsTestDirectory>
                    <phantomJsExec>test/phantomjs-1.7.0-linux-x86_64/bin/phantomjs</phantomJsExec>
                </configuration>
            </plugin>

Original issue reported on code.google.com by [email protected] on 7 Dec 2012 at 4:41

Allow phantomjs executable to be used from system PATH

Would like phantomjs to be used from the system PATH if don't specify 
'phantomjs.path' as a parameter.


I've attached a patch that makes this change, and also:

pom.xml:
- Specifying java version of 1.5 for the maven-compiler-plugin, as there's a 
java5 for-loop in the code that requires this.
PhantomJsQunitRunnerMojo.java:
- Made it assume that phantomjs executable is in the system PATH if 
'phantomjs.path' is not specified.
- Added some debug logging.

Original issue reported on code.google.com by [email protected] on 28 Dec 2011 at 10:42

Attachments:

Missing information in pom.xml

What steps will reproduce the problem?
1. copy the pom.xml plugin part in the example
2. past the part in your pom.xml file
3. run: mvn test

What is the expected output? What do you see instead?
Maven running the test.

What version of the product are you using? On what operating system?
Maven 3.0.4
phantomjs-qunit-runner 1.0.11
Ubuntu 11.10

Please provide any additional information below.
The version and executions tags where missing. This is my version of pom.xml

<plugin>
  <groupId>net.kennychua</groupId>
  <artifactId>phantomjs-qunit-runner</artifactId>
  <version>1.0.11</version>
  <executions>
    <execution>
      <goals>
        <goal>test</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <jsSourceDirectory>${project.basedir}/src/main/path/to/js/</jsSourceDirectory>
    <jsTestDirectory>${project.basedir}/src/test/path/to/js/</jsTestDirectory>
    <ignoreFailures>false</ignoreFailures>
    <phantomJsExec>/path/to/phantomjs</phantomJsExec>
  </configuration>
</plugin>



Original issue reported on code.google.com by [email protected] on 9 Mar 2012 at 9:19

Missing the qunit-html directory with test results

What steps will reproduce the problem?
1. run: mvn test

What is the expected output? What do you see instead?
I hoped to see the qunit-html directory with the test results

What version of the product are you using? On what operating system?
maven 3.0.4
phantomjs-qunit-runner 1.0.11
Ubunti 11.10

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 9 Mar 2012 at 9:22

Add ability to use fixtures

It would be nice to be able to define fixtures to use against the javascript 
since it is running against phantomjs.  The fixtures would define html that 
would be loaded up in the phantomjs page object and allow the javascript to do 
stuff to the html and then have the qunit tests run against what was done.

For example, if there is a file in the source directory:
foo.js
You can already do a test file:
fooTests.js
But you should also be able to do a fixture file:
fooFixture.html

The phantomjs-qunit-runner.js script would need to load this html into a page 
object, and the qunit tests should have access to that page object.

Original issue reported on code.google.com by [email protected] on 28 May 2012 at 10:00

Unable to load jquery.js and produces ReferenceError: Can't find variable: $

What steps will reproduce the problem?
1. I have a javascript(myBlah.js) file which uses jquery functions
2. I have a corresponding tests file myBlahTest.js which has four unit tests

3. This is what I have in my pom.xml


<plugin>
                <groupId>net.kennychua</groupId>
                <artifactId>phantomjs-qunit-runner</artifactId>
                <version>1.0.15</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>test</goal>
                            <goal>generate-html</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <jsSourceDirectory>${project.build.directory}/../src/main/webapp/scripts</jsSourceDirectory>
                    <jsTestDirectory>${project.build.directory}/../src/test/webapp/scripts</jsTestDirectory>
                    <includeLibsInDir>
                        <directory>${project.build.directory}/../src/main/webapp/scripts</directory>
                        <includes>
                            <include>jquery.js</include>
                        </includes>
                    </includeLibsInDir>
                    <phantomJsExec>${project.build.directory}/../src/test/phantomjs-1.8.0-linux-x86_64/bin/phantomjs</phantomJsExec>
                </configuration>
            </plugin>

What is the expected output? What do you see instead?
The test pass if I run it manually through the html file . But I see this in 
the generated XML file

    <testcase time="0" name="global failure">
        <failure type="1" message="1">PhantomJS QUnit failure on test :
            'global failure', failed assertions: 'ReferenceError: Can't find
            variable: $,
            /home/blah/myapp/src/main/webapp/scripts/myBlah.js:1'
        </failure>
    </testcase>





What version of the product are you using? On what operating system?
I am using version 1.0.15. OS is Ubuntu 10.04 LTS


Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 3 Jan 2013 at 5:08

Scan test under test directory and sub-directories

Hi,

I did some modifications for PhantomJsQunitRunnerMojo to enable it to scan all 
tests in all subdirectories. In the current release the plugin only runs test 
under the directory specified 'jsTestDirectory'. (Please see attached java file)

There's also a decent log message regarding the tests results. I am working on 
a project with numerous js files to tests and organized in different 
directories so I felt this necessary to make the plugin flexible. You guys 
might be interested with this too :D

Original issue reported on code.google.com by [email protected] on 9 Oct 2012 at 6:18

Attachments:

includeLibsInDir fails for qunit-html

What steps will reproduce the problem?
1. Create a js file (A) that references another js file (B)
2. Create a test js (ATest) for that js file
3. On the pom.xml, specify the reference under includeLibsInDir (i.e. 
<include>B.js</include>

What is the expected output? What do you see instead?
Both test (under qunit) and html (qunit-html) must pass. So far, only test 
passes, html fails.

B.js is only copied under the qunit folder, not under qunit-html (not to 
mention B.js is not referenced as a <script> in ATest.js.html)

What version of the product are you using? On what operating system?
1.0.15 on Windows XP

Please provide any additional information below.
Another thing is if I use *.js (e.g. <include>**/*.js</include>) instead of the 
specific file, mvn test also fails, though it's able to copy B.js to the qunit 
directory.

Original issue reported on code.google.com by [email protected] on 4 Jan 2013 at 7:04

generate-html fails

What steps will reproduce the problem?
1. run generate-html when target/ does not exist 

What is the expected output? What do you see instead?

I take it running generate-html afer clean is a legitimate use case, for 
instance, when wanting to create the qunit test page in a project without prior 
goals that create the target folder.

QunitHtmlWrapperMojo fails on line 176 when instantiating a new FileWriter. 
This goes back to line 85 where you have 
   new File(qUnitHtmlOutputPath).mkdir();
instead of
   new File(qUnitHtmlOutputPath).mkdirs();


What version of the product are you using? On what operating system?

1.0.15

Please provide any additional information below.

Kenny, many thanks for this very nice plugin!


Original issue reported on code.google.com by m.hild%[email protected] on 14 Feb 2013 at 2:19

Ability to add custom libraries when running tests (patch included)

I wanted to use jquery.mockjax.js in my qunit tests, but couldn't figure out 
how to add that library to the phantomjs execution.

I've added the functionality to the maven plug-in, and at the same time did a 
little refactoring of the plug-in.

It would probably make sense to change the way the test files are specified to 
also use the maven file manager. That way, you'd get filtering for free. 
I'll do that if you're interested...

patch attached.

Wouter

Original issue reported on code.google.com by [email protected] on 16 Feb 2012 at 3:00

Attachments:

Dependencies should be listed before the test file and the SUT

What steps will reproduce the problem?
1. Create a source file that requires/uses a third party library (eg: jQuery)
2. Create a test for that file
3. Run that test via Maven/phantomjs-qunit-runner with the library specified 
via <includeLibsInDir>

What is the expected output? What do you see instead?

The expected output should be that the test passes.  The current defect is that 
the test doesn't pass.

What version of the product are you using? On what operating system?
phantomjs-qunit-runner 1.0.15, Ubuntu, Java version "1.6.0_21", Phantomjs 1.7.0

Please provide any additional information below.

When phantomjs loads the SUT (that requires the third party library) the 
library is provided to phantomjs *after* the Javascript code that requires it.  
This does not make sense as a dependency should always be listed *before* the 
code that uses that dependency.

I have suggested a patch that will fix this problem, however a new release will 
need to be made.

Original issue reported on code.google.com by [email protected] on 29 Oct 2012 at 4:20

Support typical maven wildcards, or support multiple entries for js and test folders

My javascript is sorted in multiple folders. I like this arrangement and don't 
want to change it.

I would love to use this plugin if it could handle one of these approaches:

{{{
...
<configuration>
  <jsSrcDirs>
    <jsSrcDir>src/main/webapp/common</jsSrcDir>
    <jsSrcDir>src/main/webapp/components</jsSrcDir>
    <jsSrcDir>src/main/webapp/site</jsSrcDir>
  </jsSrcDirs>
  ...(mirrored for test)
</configuration>
}}}

or...

{{{
<configuration>
  <jsSrcDir>src/main/webapp/**/*.js</jsSrcDir>
  <jsTestDir>src/test/webapp/**/*Test.js</jsTestDir>
</configuration
}}}

How cool would that be? Awesome, I say!

Original issue reported on code.google.com by [email protected] on 23 Feb 2012 at 9:57

Tests containing syntax errors pass

What steps will reproduce the problem?
1. Write a test that contains a syntax error.
2. Execute mvn phantomjs-qunit-runner:test

What is the expected output? What do you see instead?
I'd expect Maven to report "BUILD FAILURE", as it does when a QUnit test fails. 
Instead, I see "BUILD SUCCESS".


What version of the product are you using? On what operating system?
1.0.14, Maven 3.0.4, Ubuntu 11.04

Please provide any additional information below.
I've attached a test project demonstrating the problem.

Original issue reported on code.google.com by [email protected] on 7 Sep 2012 at 4:39

Attachments:

generate-html fails 2

What steps will reproduce the problem?
1. run generate-html goal when jsSourceDirectory does not exist

What is the expected output? What do you see instead?

Plugin should take no action instead of failing. 

The current behaviour causes difficulties in the following situation:

I include generate-html as a default step in all my mavenized js projects 
(mandated by corporate pom). When tests have not yet been created and the 
jsSourceDirectory is empty, my version control system (git) does not copy these 
folders into Jenkins where I get subsequent build failures.  


What version of the product are you using? On what operating system?

1.0.15; ubuntu

Please provide any additional information below.

Original issue reported on code.google.com by m.hild%[email protected] on 19 Mar 2013 at 4:14

tests on subfolders inside jsTestDirectory are not been executed

What steps will reproduce the problem?
1. add a <jsTestDirectory> with subfolders
2. run tests
3. tests that are inside subfolder weren't executed

What is the expected output? What do you see instead?
Execute all tests that are inside subfolder from the <jsTestDirectory>

What version of the product are you using? On what operating system?
1.0.15 
Mac-OSx

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 24 Jan 2013 at 12:29

Don't lose subdirectories when copying user defined libraries

What steps will reproduce the problem?
1. Create a library include in a subdirectory:

<includeLibsInDir>
    <directory>src/main/webapp/scripts</directory>
    <includes>
        <include>_jQuery/jquery-1.8.1.min.js</include>
    </includes>
</includeLibsInDir>

2. The file is copied to the qunit dir without the subdirectory
   (target/qunit/jquery-1.8.1.min.js not target/qunit/_jQuery/jquery-1.8.1.min.js)

3. Phantomjs is passed the path including the subdirectory, which means the 
file cannot be found.

What is the expected output? What do you see instead?

1. We should preserve the directory structure when the files are copied, so 
that the phantomjs call works

What version of the product are you using? On what operating system?

1.0.16-SNAPSHOT on Ubuntu 12.04, phantomjs v1.4

Please provide any additional information below.

Patch attached retains directory structure when copying lib files.

Original issue reported on code.google.com by [email protected] on 4 Jan 2013 at 7:45

Attachments:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.