mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
tests: update gesture tests for api19 and api29 (#7975)
This commit is contained in:
@@ -244,7 +244,14 @@ cd ..
|
|||||||
4. Execute [`npm version`](https://docs.npmjs.com/cli/version) to bump the version of `tns-core-modules`,
|
4. Execute [`npm version`](https://docs.npmjs.com/cli/version) to bump the version of `tns-core-modules`,
|
||||||
tag the release and update the CHANGELOG.md. Don't forget to check the auto-generated CHANGELOG.md
|
tag the release and update the CHANGELOG.md. Don't forget to check the auto-generated CHANGELOG.md
|
||||||
```
|
```
|
||||||
cd tns-core-modules
|
cd nativescript-core
|
||||||
|
npm --no-git-tag-version version [major|minor|patch] -m "release: cut the %s release"
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
5. Execute [`npm version`](https://docs.npmjs.com/cli/version) to bump the version of `tns-core-modules`,
|
||||||
|
tag the release and update the CHANGELOG.md. Don't forget to check the auto-generated CHANGELOG.md
|
||||||
|
```
|
||||||
|
cd tns-core-modules-package
|
||||||
npm --no-git-tag-version version [major|minor|patch] -m "release: cut the %s release"
|
npm --no-git-tag-version version [major|minor|patch] -m "release: cut the %s release"
|
||||||
cd ..
|
cd ..
|
||||||
```
|
```
|
||||||
@@ -253,7 +260,7 @@ Usually tns-core-modules-widgets should already have been released and we need t
|
|||||||
|
|
||||||
7. Create release-branch with change log
|
7. Create release-branch with change log
|
||||||
```
|
```
|
||||||
git checkout -b release-[release-version]
|
git checkout -b release-[version]
|
||||||
```
|
```
|
||||||
|
|
||||||
7. Add changes
|
7. Add changes
|
||||||
@@ -262,9 +269,9 @@ git add changed-files
|
|||||||
git commit -m "release: cut the %s release"
|
git commit -m "release: cut the %s release"
|
||||||
git push
|
git push
|
||||||
```
|
```
|
||||||
8. Create git tag
|
8. Create git tag as git tag 6.3.0 or use git UI
|
||||||
```
|
```
|
||||||
git tag release-version
|
git tag [release-version]
|
||||||
git push --tags
|
git push --tags
|
||||||
```
|
```
|
||||||
9. Create a pull request. Be careful to base your branch on the correct branch
|
9. Create a pull request. Be careful to base your branch on the correct branch
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
"android": {
|
"android": {
|
||||||
"v8Flags": "--expose_gc"
|
"v8Flags": "--expose_gc",
|
||||||
|
"markingMode": "none"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ describe(`${imagePrefix}-suite`, () => {
|
|||||||
|
|
||||||
it("gestures_02_doubleTap", async function () {
|
it("gestures_02_doubleTap", async function () {
|
||||||
const lblDoubleTap = await driver.waitForElement("Double Tap here");
|
const lblDoubleTap = await driver.waitForElement("Double Tap here");
|
||||||
await lblDoubleTap.doubleTap();
|
await lblDoubleTap.doubleTap({ x: 20, y: 20 });
|
||||||
const result = await driver.findElementByTextIfExists("Double Tap gesture detected, true", SearchOptions.contains);
|
const result = await driver.findElementByTextIfExists("Double Tap gesture detected, true", SearchOptions.contains);
|
||||||
assert.isTrue(result != null && result !== undefined, `Gestures event 'Double Tap gesture detected, true' not detected!`);
|
assert.isTrue(result != null && result !== undefined, `Gestures event 'Double Tap gesture detected, true' not detected!`);
|
||||||
});
|
});
|
||||||
@@ -59,7 +59,7 @@ describe(`${imagePrefix}-suite`, () => {
|
|||||||
it("gestures_longPress", async function () {
|
it("gestures_longPress", async function () {
|
||||||
const lblTapOrDoubleTap = await driver.waitForElement("Tap or Double Tap");
|
const lblTapOrDoubleTap = await driver.waitForElement("Tap or Double Tap");
|
||||||
const rect = await lblTapOrDoubleTap.getRectangle();
|
const rect = await lblTapOrDoubleTap.getRectangle();
|
||||||
await lblTapOrDoubleTap.doubleTap();
|
await lblTapOrDoubleTap.doubleTap({ x: 20, y: 20 });
|
||||||
let result = await driver.findElementByTextIfExists("Last action: Double tap gesture, true", SearchOptions.contains);
|
let result = await driver.findElementByTextIfExists("Last action: Double tap gesture, true", SearchOptions.contains);
|
||||||
assert.isTrue(result != null && result !== undefined, `Gestures event 'Last action: Double tap gesture, true' not detected!`);
|
assert.isTrue(result != null && result !== undefined, `Gestures event 'Last action: Double tap gesture, true' not detected!`);
|
||||||
await driver.clickPoint(rect.x, rect.y);
|
await driver.clickPoint(rect.x, rect.y);
|
||||||
@@ -76,23 +76,23 @@ describe(`${imagePrefix}-suite`, () => {
|
|||||||
|
|
||||||
it("gestures_05_pan", async function () {
|
it("gestures_05_pan", async function () {
|
||||||
const lblSwipe = await driver.waitForElement("Pan here");
|
const lblSwipe = await driver.waitForElement("Pan here");
|
||||||
const rect = await lblSwipe.getRectangle();
|
|
||||||
await lblSwipe.pan([
|
await lblSwipe.pan([
|
||||||
{ x: rect.x + 100, y: rect.y + 100 },
|
{ x: 10, y: 20 },
|
||||||
{ x: rect.x + 140, y: rect.y + 120 },
|
{ x: 40, y: 30 },
|
||||||
{ x: rect.x + 160, y: rect.y + 120 }
|
{ x: 50, y: 60 }
|
||||||
], { x: 50, y: 50 });
|
], { x: 5, y: 5 });
|
||||||
|
|
||||||
const result = await driver.findElementByTextIfExists("Pan deltaX", SearchOptions.contains);
|
const result = await driver.findElementByTextIfExists("Pan deltaX", SearchOptions.contains);
|
||||||
const text = await result.text();
|
const text = await result.text();
|
||||||
assert.isTrue(/Pan deltaX:\d+; deltaY:\d+;, true, states: ended/.test(text), `Gestures event 'Pan deltaX: ...' not detected!`);
|
assert.isTrue(/Pan deltaX:([-+]?)\d+; deltaY:([-+]?)\d+;, true, states: ended/ig.test(text), `Gestures event 'Pan deltaX: ...' not detected!`);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("gestures_06_pinch", async function () {
|
it("gestures_06_pinch", async function () {
|
||||||
const lblPan = await driver.waitForElement("Pinch here");
|
const lblPan = await driver.waitForElement("Pinch here");
|
||||||
await lblPan.pinch("out");
|
await lblPan.pinch("out");
|
||||||
const result = await driver.findElementByTextIfExists("Pinch Scale: 1, true, states: ended", SearchOptions.contains);
|
const result = await driver.findElementByTextIfExists("Pinch Scale:", SearchOptions.contains);
|
||||||
assert.isTrue(result != null && result !== undefined, `Gestures event '"Pinch Scale: 0, true, states: ended"' not detected!`);
|
const text = await result.text();
|
||||||
|
assert.isTrue(/Pinch Scale: \d+, true, states: ended/ig.test(text), `Gestures event '"Pinch Scale: 0, true, states: ended"' not detected!`);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("gestures_07_rotate", async function () {
|
it("gestures_07_rotate", async function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user