Skip to content

Commit d8277ad

Browse files
committed
e2e: create basic Cucumber/TS framework
Signed-off-by: Victoria Dye <[email protected]>
1 parent e53eca7 commit d8277ad

File tree

8 files changed

+1374
-1
lines changed

8 files changed

+1374
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
/bin/
44
/_dist/
55
/_docs/
6+
node_modules/

.vscode/settings.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
// File formatting
23
"[markdown]": {
34
"editor.detectIndentation": false,
45
"editor.insertSpaces": false,
@@ -35,5 +36,13 @@
3536
"prerm": "shellscript",
3637
"postinstall": "shellscript",
3738
"Makefile": "makefile"
38-
}
39+
},
40+
41+
// Cucumber settings
42+
"cucumber.features": [
43+
"test/e2e/features/**/*.feature",
44+
],
45+
"cucumber.glue": [
46+
"test/e2e/features/**/*.ts"
47+
],
3948
}

test/e2e/cucumber.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"default": {
3+
"requireModule": ["ts-node/register"],
4+
"require": ["features/**/*.ts"],
5+
"publishQuiet": true,
6+
"format": ["summary"],
7+
"formatOptions": {
8+
"snippetInterface": "async-await"
9+
}
10+
}
11+
}

test/e2e/features/basic.feature

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Feature: Basic bundle server usage
2+
3+
Background: The bundle web server is running
4+
Given the bundle web server is running at port 8080
5+
6+
Scenario: First-time bundle server setup
7+
Given the bundle server has been initialized with 'https://github.com/git/git.git'
8+
When I clone from 'https://github.com/git/git.git' with a bundle URI
9+
Then bundles are downloaded and used
10+
11+
Scenario: Second-time bundle server setup
12+
Given the bundle server has been initialized with 'https://github.com/git/git.git'
13+
When I clone from 'https://github.com/git/git.git' with a bundle URI
14+
Then bundles are downloaded and used
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import * as assert from 'assert'
2+
import * as child_process from 'child_process'
3+
import { Given, When, Then } from '@cucumber/cucumber'
4+
5+
Given('the bundle web server is running at port {int}', async function(port: number) {
6+
console.log(`Hosting bundle web server at ${port}`)
7+
})
8+
9+
Then('bundles are downloaded and used', async function() {
10+
// const exec = util.promisify(child_process.exec)
11+
// const stdout, stderr = exec('git status')
12+
// child_process
13+
const child = child_process.spawnSync("git status", { shell: true })
14+
console.log(child.stderr.toString())
15+
assert.strict(true)
16+
})
17+
18+
When('I clone from {string} with a bundle URI', async function(url: string) {
19+
console.log(`Cloning from ${url}`)
20+
})
21+
22+
Given('the bundle server has been initialized with {string}', async function(url: string) {
23+
console.log(`Initializing bundle server with ${url}`)
24+
})

0 commit comments

Comments
 (0)