How can I check if a js file is included in my web page? I had a look of a lot of Selenium Documentations, but i did not find what i want.
Thanks a lot for you reply.
I found the answer of my own question (with the JUnit 3 format):
verifyTrue(selenium.isElementPresent("//script[#type='text/javascript'][contains(#src,'my.js')]"));
Related
I am trying to validate a file upload using test cafe.the things are fine when I give absolute path of the file with in the t.setFilesToUpload() but when I give relative path its not finding the files and says could not find the required file. Can anyone help with this?
I tried using relative path of the file to be uploaded.
It's not clear how you validate file upload. Please refer to the related help topic in the TestCafe documentation. If you still have issues after reviewing it, please share an example that reproduces the issue.
Can I use links in different site in setValue in file upload using nightwatch? I look up a link in stackoverflow and see this: File Upload Testing in Nightwatch.js but the answer said that it will not work if the file is coming from 'http://localhost:3000/testfile.txt'. Is this not possible?
The simple answer is no you can not specify the web server path.
You can read more about here.
What you can do is First download file and then use its absolutes or relative paths to upload.
I use YUI Compressor in Symfony2 with assetic bundle.
I have a problem:
If a jquery file start with /* comments I get syntax error....
In order to get rid of it I need to delete all /* comments from all js files...
This is starting to be a problem as everytime I update other bundles the comments are returning.
Anyone have an idea how to sovle this? Is this a known issue?
YUI Compressor version: 2.4.8
Thanks a lot.
Cannot seem to find why this is happening. It is most likely a bug. If you use Dreamweaver, try using this to ease your work. If you are not using dreamweaver, find your favourite program here.
Hope this helps!
Check the encoding on your file. I've had problems with YUI Compressor if my .js and .css files were not UTF-8.
Well, I have a problem trying to setup code coverage reports. First thing I had to do was to install xdebug, I did it, and it worked...Well, actually, instead of showing me the coverage of my test code it shows a couple of files inside of PHPUnit module's directory, and some other strange files from framework's system directory such as:
C:/xampp/htdocs/.../src/modules/Unittest/classes/kohana/unittest/helpers.php
C:/xampp/htdocs/.../src/modules/Unittest/classes/unittest/helpers.php
C:/xampp/htdocs/.../src/system/classes/kohana/config.php
Another problem is that the coverage files that should be html reports which are created with every "phpunit" command executed are always saved to the C:// directory. I tried to change it in xdebug settings in php.ini, but none worked.
Does anybody knows what could be the reason?
I'm using Jenkins if this is any helpful info.
And please tell me if you need more info.
Thanks.
C:/xampp/htdocs/.../src/modules/Unittest/classes/kohana/unittest/helpers.php
C:/xampp/htdocs/.../src/modules/Unittest/classes/unittest/helpers.php
C:/xampp/htdocs/.../src/system/classes/kohana/config.php
These files seem like test helpers and config. PHPUnit will generate code coverage for every file that doesn't just contain unit tests.
If you don't want these files to show up use excludes in your phpunit.xml file
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
<exclude>
<directory suffix=".php">tests</directory>
<file>src/system/classes/kohana/config.php</file>
</exclude>
</whitelist>
To answer the second question we'd need to see how you run the tests and your phpunit.xml.
For later please consider putting only one answerable question per "question" you open up. As this is not a forum and each question should be one solved issue it's easier to get answers for your stuff :)
symfony1.x followed a good standart that the whole framework lies somewhere outside and is available to any project. Today I started to read symfony2 documentation and actually downloaded the 'with vendors' 2.0.1 package which is presented on download page. After opening the package I was a bit surprised of what I've seen. But after looking around the package I found that the only folder I need is 'vendors' one - so I copied its content to my '...\lib\vendor\symfony2' folder (near '...\lib\vendor\symfony' and '...\lib\vendor\ext'). I added it to include path and proceed reading documentation. And then I found a problem - a command listed 'php app/console generate:bundle --namespace=Acme/HelloBundle --format=yml' produced simple questions. Did they miss to explain how to generate a project (structure, preconfiguration, command-line files, etc)? And what about '.bat' and '.sh' files?
Symfony2 is very, very different than symfony 1 - especially when it comes to the directory structure. You can't simply drop in the vendors dir and expect it to work. This page explains how to setup a new Symfony2 project.
I recommend you to forget Symfony... and to think with Symfony2 about another think completely different than S1.
Installation is really simple and you will need some advanced PHP knowledge just to understand how it works... But if you have worked with S1, I expect you will have not much problems :)