I would like to attach several files to run my test in Laravel 5.2 and Codeception 2.1.6.
I have an input :
<input type="file" id="shapefiles" name="files[]" multiple>
When I try to attach some files to it like this :
$I->attachFile('files[]', 'districts/shapefiles/admin2.dbf');
$I->attachFile('files[]', 'districts/shapefiles/admin2.shp');
I get the error :
[TestRuntimeException] None of form fields by files[] were not matched
I can't reproduce the behaviour I would like to test here.
I didn't find any advice on my friend Google. How could I manage to do that ?
Related
My HTML fragment is:
<label class="email">
Email
<input data-test="email" type="text" v-model="curMember.email_address">
</label>
Then in my cypress test the following 'GET' does not work (using attribute selector):
cy.get('[data-test="email"]').should('have.value', 'a#test.com')
the above times out trying to find the element but the folowing does work (using a class selector)
cy.get('.email>input').should('have.value', 'a#test.com')
Can anyone tell me what my problem is?
I am not sure that cypress provides of getting value from NON-class
but take a look at this https://docs.cypress.io/api/commands/get.html#Selector
for the first example, you can only check the length
cy.get('[data-test="email"]').should('have.length', '10')
I'm stuck with a Yii 1 implementation that has a CJuiDatePicker. I notice it creates <input type="text"> but I want it to create a <input type="date">. Is this possible?
I tried using htmlOptions to set it but that didn't seem to make a difference.
I'm so new in writing scenarios for e2e testing in Angularjs. I want to write a scenario to test the login. I have a form which has an email field as follow:
<input type="email" placeholder="Enter your e-mail" name="email" ng-model="form.email" value="" required autofocus >
And in my scenario I'm having having the following line which tries to pass some email address to that input field:
input('form.email').enter('blabla#blabla.com');
But unfortunately I'me getting the following error after running the test:
6ms input 'form.email' enter 'blabla#blabla.com'
Selector [ng\:model="form.email"] did not match any elements.
Any suggestion?
check to make sure that you have:
browser().navigateTo('/');
Without navigating first angular does not have any reference to the DOM.
You can also use :
pause();
To see exactly what the browser is displaying at the given time when running an e2e test.
I have an input box with placeholder.and I am setting the value in this field via Session variable in php.
This is the code which I have written :
<input type="text" value=<?=$_SESSION['no_of_persons']?> name="no_of_persons" id="no_of_persons" placeholder="No. of Person(s)" maxlength="3" />
and when I run this in firefox and watching the code in Firebug this following code is coming :
<input id="no_of_persons" type="text" maxlength="3" placeholder="No. of Person(s)" name="no_of_persons" value="7">
Problem is I am not able to see the value in textfield in the web page.
I go to firebug and edit html in firebug. What I do is when I press an space key at the end of input tag i.e after value="7" then the value 7 becomes visible on web page.
I am not getting why the browser automatically changing the sequence of attributes of input tag and also I already had closed input tag then why the browser not closing it.
I tried it in other browser also like safari,chrome but not working.
Please help me to get rid off this problem.
Thanks in advance!!! :)
while writing some acceptance tests for my webapp (playframework based),I got confused by the usage of some selenium commands.
In my html page,I have a submit button like this
<input type="submit" id="removecartitem" value="remove"/>
to locate this,I used
assertElementPresent(id='removecartitem')
however,this fails,
assertElementPresent id='removecartitem' false
The selenium documentation says
id=id: Select the element with the specified #id attribute.
but,if i simply put
assertElementPresent('removecartitem')
Then,the test is executed correctly.This is the source for confusion, since the default way is to select the element whose name attribute is 'removecartitem' ,and I haven't mentioned any name attribute in my html
Any idea why this happens?
It looks like you need to remove the single quotes according to the documentation you provided...e.g:
assertElementPresent(id=removecartitem)