@taqwright/taqwright 0.0.26 → 0.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1157,8 +1157,6 @@ export const INSPECTOR_HTML = `<!doctype html>
1157
1157
  <div class="card card-caps flex">
1158
1158
  <div class="card-head">
1159
1159
  <h2>Capabilities</h2>
1160
- <span class="grow"></span>
1161
- <button class="icon" id="btn-caps-reset" title="Reset to defaults from taqwright.config.ts">↺ Reset</button>
1162
1160
  </div>
1163
1161
  <div class="caps-fields">
1164
1162
  <div class="field">
@@ -1728,8 +1726,7 @@ await mobile.getByUiSelector('new UiSelector().description("Login")').click();</
1728
1726
  <code>↻ Refresh</code> the list, and <b>Start</b> a shutdown emulator (or select a
1729
1727
  running one / a cloud device).</li>
1730
1728
  <li><b>Step 3 — App &amp; capabilities:</b> point at the app under test with
1731
- <b>Browse…</b>, tweak or <b>+ Add</b> Appium capabilities (<b>↺ Reset</b> restores the
1732
- config defaults), then <b>Connect →</b>.</li>
1729
+ <b>Browse…</b>, tweak or <b>+ Add</b> Appium capabilities, then <b>Connect →</b>.</li>
1733
1730
  </ul>
1734
1731
  </div>
1735
1732
  </details>
@@ -4074,7 +4071,6 @@ await mobile.getByUiSelector('new UiSelector().description("Login")').click();</
4074
4071
  $('btn-appium-recheck').onclick = refreshAppiumPill;
4075
4072
  $('btn-appium-restart').onclick = restartAppium;
4076
4073
  $('btn-appium-start').onclick = startAppium;
4077
- $('btn-caps-reset').onclick = () => applyCapsToForm(initial.defaults.capabilities);
4078
4074
  $('btn-connect').onclick = doConnect;
4079
4075
  $('btn-add-cap').onclick = () => addExtraRow({ key: '', value: '' }, true);
4080
4076
  $('btn-devices-refresh').onclick = loadDevices;
@@ -4288,7 +4284,9 @@ await mobile.getByUiSelector('new UiSelector().description("Login")').click();</
4288
4284
  if (step === 1) {
4289
4285
  return isCloudMode() ? cloudCredsValid : $('appium-pill').classList.contains('live');
4290
4286
  }
4291
- if (step === 2) return !!$('cap-device').value.trim();
4287
+ // Require an actual selected, booted device — not just a pre-filled
4288
+ // cap-device value (config defaults seed it, which would wrongly enable Next).
4289
+ if (step === 2) return selectedDeviceKey !== null;
4292
4290
  return true;
4293
4291
  }
4294
4292
 
@@ -4553,8 +4551,10 @@ await mobile.getByUiSelector('new UiSelector().description("Login")').click();</
4553
4551
  return;
4554
4552
  }
4555
4553
  if (wizardStep === 2) {
4556
- const sel = $('cap-device').value.trim();
4557
- if (sel) {
4554
+ // Gate on the real selection (a tapped, booted device), not the pre-filled
4555
+ // cap-device value — otherwise Next is enabled before any live device is picked.
4556
+ if (selectedDeviceKey !== null) {
4557
+ const sel = $('cap-device').value.trim();
4558
4558
  summary.innerHTML =
4559
4559
  'Selected <strong>' + escapeHtml(sel) + '</strong> — click <strong>Next</strong> or pick another device.';
4560
4560
  nextBtn.disabled = false;
@@ -4719,6 +4719,20 @@ await mobile.getByUiSelector('new UiSelector().description("Login")').click();</
4719
4719
  function renderDevices() {
4720
4720
  const data = lastDeviceData;
4721
4721
 
4722
+ // Drop a stale selection: if the selected device is no longer booted (e.g.
4723
+ // it was stopped, or shut down between polls), clear it so Next disables —
4724
+ // a selection must always point at a currently-live device.
4725
+ if (selectedDeviceKey !== null) {
4726
+ const all = [...(data.android || []), ...(data.ios || [])];
4727
+ const stillLive = all.some((d) => d.state === 'booted' && bootingKey(d) === selectedDeviceKey);
4728
+ if (!stillLive) {
4729
+ selectedDeviceKey = null;
4730
+ selectedCloudDevice = null;
4731
+ $('cap-device').value = '';
4732
+ updateConnectSummary();
4733
+ }
4734
+ }
4735
+
4722
4736
  // Tool-missing warnings.
4723
4737
  const warns = [];
4724
4738
  if (data.toolsMissing?.adb) warns.push("adb not on PATH — Android emulators won't show.");
@@ -4932,7 +4946,9 @@ await mobile.getByUiSelector('new UiSelector().description("Login")').click();</
4932
4946
  const found = list.find((d) => bootingKey(d) === key);
4933
4947
  if (found && found.state === 'booted') {
4934
4948
  bootingDevices.delete(key);
4935
- renderDevices();
4949
+ // Auto-select the device the user just started — no manual click needed.
4950
+ // selectDevice() also re-renders (✓) and enables Next (gated on selection).
4951
+ selectDevice(found);
4936
4952
  showToast(dev.name + ' is up and ready.', 'success', { title: 'Device booted' });
4937
4953
  return;
4938
4954
  }
@@ -5284,7 +5300,7 @@ await mobile.getByUiSelector('new UiSelector().description("Login")').click();</
5284
5300
  { sel: '#btn-devices-refresh', before: function () { goToStep(2); }, title: 'Step 2 — Pick a device',
5285
5301
  body: 'Switch the <b>Android / iOS</b> tabs and <b>↻ Refresh</b> the list. <b>Start</b> a shutdown emulator, or pick a running one / a cloud device.' },
5286
5302
  { sel: '#btn-app-browse', before: function () { goToStep(3); }, title: 'Step 3 — App & capabilities',
5287
- body: 'Point at the app under test with <b>Browse…</b>, then tweak or <b>+ Add</b> Appium capabilities (<b>↺ Reset</b> restores config defaults).' },
5303
+ body: 'Point at the app under test with <b>Browse…</b>, then tweak or <b>+ Add</b> Appium capabilities.' },
5288
5304
  { sel: '#btn-connect', before: function () { goToStep(3); }, title: 'Connect',
5289
5305
  body: 'Hit <b>Connect →</b> to open the session and enter the inspector.' },
5290
5306
  { sel: null, title: 'You are set',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taqwright/taqwright",
3
- "version": "0.0.26",
3
+ "version": "0.0.27",
4
4
  "description": "E2E mobile testing on the Playwright runner",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -42,7 +42,7 @@
42
42
  "test:watch": "node --test --watch test/*.test.js",
43
43
  "test:e2e": "playwright test --config e2e/playwright.config.ts",
44
44
  "test:coverage": "npm run build && node --test --experimental-test-coverage test/*.test.js",
45
- "prepare": "npm run build",
45
+ "prepare": "node scripts/prepare.mjs",
46
46
  "prepublishOnly": "npm run build",
47
47
  "version": "node scripts/sync-readme-version.mjs && git add README.md"
48
48
  },