Skip to content

Commit 1ebef27

Browse files
committed
bump version
1 parent 24860b5 commit 1ebef27

3 files changed

Lines changed: 69 additions & 70 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "appium-interceptor",
3-
"version": "1.0.0.beta-1",
3+
"version": "1.0.0-beta.1",
44
"description": "Appium 2.0 plugin to mock api calls for android apps",
55
"main": "./lib/index.js",
66
"scripts": {

test/plugin.spec.js

Lines changed: 66 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -26,65 +26,64 @@ describe('Plugin Test', () => {
2626
const mockId = await driver.execute('interceptor: addMock', {
2727
config: {
2828
url: '/api/users?.*',
29-
responseBody:
30-
JSON.stringify({
31-
page: 1,
32-
per_page: 6,
33-
total: 12,
34-
total_pages: 2,
35-
data: [
36-
{
37-
id: 1,
38-
email: 'saikrishna.bluth@reqres.in',
39-
first_name: 'George',
40-
last_name: 'Bluth',
41-
avatar: 'https://reqres.in/img/faces/1-image.jpg',
42-
},
43-
{
44-
id: 2,
45-
email: 'janet.weaver@reqres.in',
46-
first_name: 'Janet',
47-
last_name: 'Weaver',
48-
avatar: 'https://reqres.in/img/faces/2-image.jpg',
49-
},
50-
{
51-
id: 3,
52-
email: 'emma.wong@reqres.in',
53-
first_name: 'Emma',
54-
last_name: 'Wong',
55-
avatar: 'https://reqres.in/img/faces/3-image.jpg',
56-
},
57-
{
58-
id: 4,
59-
email: 'eve.holt@reqres.in',
60-
first_name: 'Eve',
61-
last_name: 'Holt',
62-
avatar: 'https://reqres.in/img/faces/4-image.jpg',
63-
},
64-
{
65-
id: 5,
66-
email: 'charles.morris@reqres.in',
67-
first_name: 'Charles',
68-
last_name: 'Morris',
69-
avatar: 'https://reqres.in/img/faces/5-image.jpg',
70-
},
71-
{
72-
id: 6,
73-
email: 'tracey.ramos@reqres.in',
74-
first_name: 'Tracey',
75-
last_name: 'Ramos',
76-
avatar: 'https://reqres.in/img/faces/6-image.jpg',
77-
},
78-
],
79-
support: {
80-
url: 'https://reqres.in/#support-heading',
81-
text: 'To keep ReqRes free, contributions towards server costs are appreciated!',
29+
responseBody: JSON.stringify({
30+
page: 1,
31+
per_page: 6,
32+
total: 12,
33+
total_pages: 2,
34+
data: [
35+
{
36+
id: 1,
37+
email: 'saikrishna.bluth@reqres.in',
38+
first_name: 'George',
39+
last_name: 'Bluth',
40+
avatar: 'https://reqres.in/img/faces/1-image.jpg',
41+
},
42+
{
43+
id: 2,
44+
email: 'janet.weaver@reqres.in',
45+
first_name: 'Janet',
46+
last_name: 'Weaver',
47+
avatar: 'https://reqres.in/img/faces/2-image.jpg',
48+
},
49+
{
50+
id: 3,
51+
email: 'emma.wong@reqres.in',
52+
first_name: 'Emma',
53+
last_name: 'Wong',
54+
avatar: 'https://reqres.in/img/faces/3-image.jpg',
55+
},
56+
{
57+
id: 4,
58+
email: 'eve.holt@reqres.in',
59+
first_name: 'Eve',
60+
last_name: 'Holt',
61+
avatar: 'https://reqres.in/img/faces/4-image.jpg',
62+
},
63+
{
64+
id: 5,
65+
email: 'charles.morris@reqres.in',
66+
first_name: 'Charles',
67+
last_name: 'Morris',
68+
avatar: 'https://reqres.in/img/faces/5-image.jpg',
8269
},
83-
}),
70+
{
71+
id: 6,
72+
email: 'tracey.ramos@reqres.in',
73+
first_name: 'Tracey',
74+
last_name: 'Ramos',
75+
avatar: 'https://reqres.in/img/faces/6-image.jpg',
76+
},
77+
],
78+
support: {
79+
url: 'https://reqres.in/#support-heading',
80+
text: 'To keep ReqRes free, contributions towards server costs are appreciated!',
81+
},
82+
}),
8483
},
8584
});
8685
expect(mockId).to.not.be.null;
87-
const el1 = await driver.$("xpath://android.widget.TextView[@text=\"Get User List\"]");
86+
const el1 = await driver.$('xpath://android.widget.TextView[@text="Get User List"]');
8887
await el1.click();
8988
const page = await driver.getPageSource();
9089
expect(page.includes('saikrishna.bluth@reqres.in')).to.be.true;
@@ -95,19 +94,19 @@ describe('Plugin Test', () => {
9594
config: {
9695
url: '/api/users?.*',
9796
updateResponseBody: [
98-
{
99-
jsonPath: '$.data[?(/tracey.*/.test(@.email))].first_name',
100-
value: 'sudharsan',
101-
},
102-
{
103-
jsonPath: '$.data[?(/tracey.*/.test(@.email))].last_name',
104-
value: 'selvaraj',
105-
},
106-
],
97+
{
98+
jsonPath: '$.data[?(/tracey.*/.test(@.email))].first_name',
99+
value: 'sudharsan',
100+
},
101+
{
102+
jsonPath: '$.data[?(/tracey.*/.test(@.email))].last_name',
103+
value: 'selvaraj',
104+
},
105+
],
107106
},
108107
});
109108
expect(mockId).to.not.be.null;
110-
const el1 = await driver.$("xpath://android.widget.TextView[@text=\"Get User List\"]");
109+
const el1 = await driver.$('xpath://android.widget.TextView[@text="Get User List"]');
111110
await el1.click();
112111
const page = await driver.getPageSource();
113112
expect(page.includes('sudharsan')).to.be.true;
@@ -118,11 +117,11 @@ describe('Plugin Test', () => {
118117
const mockId = await driver.execute('interceptor: addMock', {
119118
config: {
120119
url: '/api/users?.*',
121-
statusCode: 400
120+
statusCode: 400,
122121
},
123122
});
124123
expect(mockId).to.not.be.null;
125-
const el1 = await driver.$("xpath://android.widget.TextView[@text=\"Get User List\"]");
124+
const el1 = await driver.$('xpath://android.widget.TextView[@text="Get User List"]');
126125
await el1.click();
127126
const page = await driver.getPageSource();
128127
expect(page.includes('Error')).to.be.true;

0 commit comments

Comments
 (0)