Skip to content

Commit

Permalink
Merge branch 'develop' into cukexit
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrthomas committed Aug 16, 2018
2 parents fcd58cc + edeae17 commit a1c4b82
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void readSideProject() {
Assert.assertTrue(suites.get(1).getTests().size() == 1);
Assert.assertTrue(suites.get(1).getTests().size() == 1);

File dir = file.getParentFile();
File dir = new File("target");
String configJson = "{'browser':'chrome','url':'http://localhost:9515'}";
String featureText = SideConverter.toKarateFeature(project, configJson, dir);
String contents = FileUtils.toString(new File(dir, project.getIdentifierName() + ".feature"));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.intuit.karate.junit4.selenium;

import com.intuit.karate.junit4.Karate;
import cucumber.api.CucumberOptions;
import org.junit.runner.RunWith;

/**
*
* @author pthomas3
*/
@RunWith(Karate.class)
@CucumberOptions(features = "classpath:com/intuit/karate/junit4/selenium/sample.feature")
public class SampleRunner {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
@ignore
Feature: no-name-default-test-suite
url = https://github.com/
with parameters
session.id, session.url

Scenario: Test-1-of-Default-Suite-136573f0-2437-48aa-9bfe-457f0c88ee8b
# # TestCommand{id='a84bb8d4-b05a-4817-8cf6-457beaaba7cc', comment='', command='open', target='/', value=''}

* url 'http://localhost:9515'

* path 'session'
* request { desiredCapabilities: { browserName: 'Chrome' } }
* method post
* status 200
* def sessionId = response.sessionId

* path 'session', sessionId, 'url'
* request { url: 'https://google.com' }
* method post
* status 200

* def sessionPath = 'session/' + sessionId

Given path sessionPath, 'url'
And request {url:'https://github.com/'}
When method POST
Then status 200
And assert response.status == 0

# # TestCommand{id='f4322a13-ab17-4961-b9b7-745dd42a2195', comment='', command='mouseOver', target='//div[@id='dashboard']/div/a', value=''}

# # TestCommand{id='bed92dae-1ea6-458b-b051-4b3666fa5b80', comment='', command='clickAt', target='name=q', value='93,24'}
Given path sessionPath, 'element'
And request {using:'name', value:'q'}
When method POST
Then status 200
And assert response.status == 0
* def webdriverElementId = response.value.ELEMENT
* print 'Element ID is 'webdriverElementId
Given path sessionPath, 'element', webdriverElementId, 'click'
And request {}
When method POST
Then status 200
And assert response.status == 0

# # TestCommand{id='a2bb0a5e-6967-40e7-8a67-516bfe380dba', comment='', command='store', target='karate', value='searchFor'}

# # TestCommand{id='641fc6bf-e1e1-4089-a6e7-884f849d0028', comment='', command='type', target='name=q', value='karate'}
Given path sessionPath, 'element'
And request {using:'name', value:'q'}
When method POST
Then status 200
And assert response.status == 0
* def webdriverElementId = response.value.ELEMENT
* print 'Element ID is 'webdriverElementId
Given path sessionPath, 'element', webdriverElementId, 'value'
And request {value:['karate']}
When method POST
Then status 200
And assert response.status == 0

# # TestCommand{id='81dbc283-9531-4005-8bd4-b4d3c95d6c81', comment='', command='sendKeys', target='name=q', value='${KEY_ENTER}'}
Given path sessionPath, 'element'
And request {using:'name', value:'q'}
When method POST
Then status 200
And assert response.status == 0
* def webdriverElementId = response.value.ELEMENT
* print 'Element ID is 'webdriverElementId
Given path sessionPath, 'element', webdriverElementId, 'value'
And request {value:['${KEY_ENTER}']}
When method POST
Then status 200
And assert response.status == 0

0 comments on commit a1c4b82

Please sign in to comment.