Skip to content

Commit b50aff8

Browse files
Copilotkobenguyent
andcommitted
Changes before error encountered
Co-authored-by: kobenguyent <[email protected]>
1 parent a08063f commit b50aff8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+112
-164
lines changed

lib/assert/equal.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ const equalModule = {
5555

5656

5757
// Export named functions
58-
export { Assertion, equals }
58+
export const equals = jar => new EqualityAssertion({ jar })
59+
export const fileEquals = file => new EqualityAssertion({ file, jar: 'contents of {{file}}' })
60+
export { EqualityAssertion as Assertion }
5961

6062
export default equalModule

lib/assert/include.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,12 @@ const includeModule = {
7373

7474

7575
// Export named functions
76-
export { Assertion, includes }
76+
export const includes = needleType => {
77+
needleType = needleType || 'string'
78+
return new InclusionAssertion({ jar: needleType })
79+
}
80+
export const fileIncludes = file => new InclusionAssertion({ file, jar: 'file {{file}}' })
81+
export { InclusionAssertion as Assertion }
7782

7883
export default includeModule
7984

lib/assert/truth.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const truthModule = {
3737

3838

3939
// Export named functions
40-
export { Assertion, truth }
40+
export const truth = (subject, type) => new TruthAssertion({ subject, type })
41+
export { TruthAssertion as Assertion }
4142

4243
export default truthModule

test/acceptance/session_test.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ Scenario('should work with within @Puppeteer @Playwright', ({ I }) => {
154154
})
155155

156156
Scenario('change page emulation @Playwright', async ({ I }) => {
157-
import assert from 'assert'
158157
I.amOnPage('/')
159158
session(
160159
'mobile user',
@@ -170,9 +169,7 @@ Scenario('change page emulation @Playwright', async ({ I }) => {
170169
})
171170

172171
Scenario('emulate iPhone @Playwright', async ({ I }) => {
173-
import { devices } from 'playwright'
174172
if (process.env.BROWSER === 'firefox') return
175-
import assert from 'assert'
176173
I.amOnPage('/')
177174
session('mobile user', devices['iPhone 6'], async () => {
178175
I.amOnPage('/')

test/data/dummy_page.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
const { I } = inject()
2-
31
export default {
42
openDummyPage: () => 'dummy page opened',
5-
getI: () => I,
3+
getI: () => {
4+
// This function is called within test context where inject is available
5+
if (typeof inject !== 'undefined') {
6+
const { I } = inject()
7+
return I
8+
}
9+
return null
10+
},
611
}

test/data/graphql/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import path from 'path'
22
import { fileURLToPath } from 'url'
33

4-
import path from 'path'
54
import jsonServer from 'json-server'
65
import { ApolloServer } from '@apollo/server'
76
import { startStandaloneServer } from '@apollo/server/standalone'

test/graphql/GraphQLDataFactory_test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ require('../support/setup')
22
import path from 'path'
33
import { fileURLToPath } from 'url'
44

5-
import path from 'path'
65
import fs from 'fs'
76

87
import TestHelper from '../support/TestHelper.js'

test/graphql/GraphQL_test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import path from 'path'
22
import { fileURLToPath } from 'url'
33

4-
import path from 'path'
54
import fs from 'fs'
65

76
import TestHelper from '../support/TestHelper.js'

test/helper/Appium_ios_test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ import { fileURLToPath } from 'url'
33

44
import chai from 'chai'
55

6-
const expect = chai.expect
6+
const { expect } = chai
77
const assert = chai.assert
8-
import path from 'path'
98

109
import Appium from '../../lib/helper/Appium.js'
1110
import AssertionFailedError from '../../lib/assert/error.js'

test/helper/Appium_test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ import { fileURLToPath } from 'url'
33

44
import chai from 'chai'
55

6-
const expect = chai.expect
6+
const { expect } = chai
77
const assert = chai.assert
8-
import path from 'path'
98

109
import Appium from '../../lib/helper/Appium.js'
1110
import AssertionFailedError from '../../lib/assert/error.js'

0 commit comments

Comments
 (0)