Skip to content

Commit

Permalink
Cucumber adjusment
Browse files Browse the repository at this point in the history
  • Loading branch information
rrfaria committed Apr 17, 2017
1 parent 1258be3 commit fd07c51
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 19 deletions.
3 changes: 2 additions & 1 deletion features/step_definitions/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ module.exports = function () {
// Write code here that turns the phrase above into concrete actions
const fileToUpload = './features/bdd-test.png';
const absolutePath = path.resolve(__dirname, fileToUpload);
console.log('path:',absolutePath);
driver.findElement(by.css('input[type=file]')).sendKeys(absolutePath);
callback();
});
Expand Down Expand Up @@ -90,7 +91,7 @@ module.exports = function () {
// Write code here that turns the phrase above into concrete actions
setTimeout(function(){
callback(null, 'pending');
}, 11000);
}, 21000);
});


Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import lsManager from './utils/lsManager';
import $ from './utils/elementSelector';
import FEgine from './utils/fariaEngine';
import blockContainer from'./utils/blockContainer';
import imputer from './utils/imputer';

let imgContainer = document.querySelector('#app .root .block-container .mainPanel .shape');
let inputImg = document.querySelector('#app .root .block-container .mainPanel .shape .photo');
Expand Down
4 changes: 2 additions & 2 deletions src/utils/cloudnary.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default class Cloudnary {
let theurl ="";
formData.append('file',file);
formData.append('upload_preset',this.uploadPreset);
console.log(this.params);
//console.log(this.params);

fetch(this.url, {
method: 'POST',
Expand Down Expand Up @@ -71,7 +71,7 @@ export default class Cloudnary {
//let fileType = fileInput.files[0].name.match(/.(jpg|jpeg|png|gif)$/i);
reader.readAsDataURL(file); //reads the data as a URL
} else {
console.warn('no image selected');
//console.warn('no image selected');
preview.src = "assets/images/shape-one.jpg";
}
}
Expand Down
39 changes: 23 additions & 16 deletions src/utils/imputer.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,37 @@
import FEgine from './fariaEngine';
/** @jsx FEgine.h */
export default class imputer {
constructor() {

}

static mount(iType,iName, iID, iClass,iTtitle,iImage="assets/images/shape-one.jpg",iIcon, iReq=false){
let required = (iReq)?"required":"";
let mount;
switch (iType){
case 'text':
return '<div class="Inputer">'+
'<input type="text" name="'+iName+'" id="'+iID+'" class="'+iClass+'" required="'+required+'">'+
'<label for="txtTelefone" class="floating-label">'+iTtitle+'</label>'+
'<span class="'+iIcon+'"></span>'+
'</div>';
return (
<div className="Inputer">
<input type="text" name={iName} id={iID} className={iClass} required={required}/>
<label for={iName} className="floating-label">{iTtitle}</label>
<span className={iIcon}></span>
</div>

);
break;
case 'upload':
return '<div class="shape">'+
'<a href="#" class="overlay hexagon"></a>'+
'<div class="details">'+
'<a href="#" class="button">'+iTtitle+'</a>'+
'</div>'+
'<div class="bg"></div>'+
'<div class="base">'+
'<img src="'+iImage+'" alt="'+iTtitle+'">'+
'</div>'+
'<input type="file" class="photo upload-button" name="'+iName+'" id="'+iID+'">'+
'</div>';
return (<div className="shape">
<a href="#" class="overlay hexagon"></a>
<div className="details">
<a href="#" class="button">{iTtitle}</a>
</div>
<div className="bg"></div>
<div className="base">
<img src={iImage} alt={iTtitle}/>
</div>
<input type="file" className="photo upload-button" name={iName} id={iID}/>
</div>
);
break;
default:
break;
Expand Down

0 comments on commit fd07c51

Please sign in to comment.