Merge pull request #1 from HeartlessHero/master
修复:在第 5 步中,优先使用可见的年龄输入框,而非隐藏的生日字段
This commit is contained in:
+37
-6
@@ -1013,19 +1013,50 @@ async function step5_fillNameBirthday(payload) {
|
|||||||
|
|
||||||
let birthdayMode = false;
|
let birthdayMode = false;
|
||||||
let ageInput = null;
|
let ageInput = null;
|
||||||
|
let yearSpinner = null;
|
||||||
|
let monthSpinner = null;
|
||||||
|
let daySpinner = null;
|
||||||
|
let hiddenBirthday = null;
|
||||||
|
let yearReactSelect = null;
|
||||||
|
let monthReactSelect = null;
|
||||||
|
let dayReactSelect = null;
|
||||||
|
let visibleAgeInput = false;
|
||||||
|
let visibleBirthdaySpinners = false;
|
||||||
|
let visibleBirthdaySelects = false;
|
||||||
|
|
||||||
for (let i = 0; i < 100; i++) {
|
for (let i = 0; i < 100; i++) {
|
||||||
const yearSpinner = document.querySelector('[role="spinbutton"][data-type="year"]');
|
yearSpinner = document.querySelector('[role="spinbutton"][data-type="year"]');
|
||||||
const monthSpinner = document.querySelector('[role="spinbutton"][data-type="month"]');
|
monthSpinner = document.querySelector('[role="spinbutton"][data-type="month"]');
|
||||||
const daySpinner = document.querySelector('[role="spinbutton"][data-type="day"]');
|
daySpinner = document.querySelector('[role="spinbutton"][data-type="day"]');
|
||||||
const hiddenBirthday = document.querySelector('input[name="birthday"]');
|
hiddenBirthday = document.querySelector('input[name="birthday"]');
|
||||||
ageInput = document.querySelector('input[name="age"]');
|
ageInput = document.querySelector('input[name="age"]');
|
||||||
|
yearReactSelect = findBirthdayReactAriaSelect('年');
|
||||||
|
monthReactSelect = findBirthdayReactAriaSelect('月');
|
||||||
|
dayReactSelect = findBirthdayReactAriaSelect('天');
|
||||||
|
|
||||||
if ((yearSpinner && monthSpinner && daySpinner) || hiddenBirthday) {
|
visibleAgeInput = Boolean(ageInput && isVisibleElement(ageInput));
|
||||||
|
visibleBirthdaySpinners = Boolean(
|
||||||
|
yearSpinner
|
||||||
|
&& monthSpinner
|
||||||
|
&& daySpinner
|
||||||
|
&& isVisibleElement(yearSpinner)
|
||||||
|
&& isVisibleElement(monthSpinner)
|
||||||
|
&& isVisibleElement(daySpinner)
|
||||||
|
);
|
||||||
|
visibleBirthdaySelects = Boolean(
|
||||||
|
yearReactSelect?.button
|
||||||
|
&& monthReactSelect?.button
|
||||||
|
&& dayReactSelect?.button
|
||||||
|
&& isVisibleElement(yearReactSelect.button)
|
||||||
|
&& isVisibleElement(monthReactSelect.button)
|
||||||
|
&& isVisibleElement(dayReactSelect.button)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (visibleAgeInput) break;
|
||||||
|
if (visibleBirthdaySpinners || visibleBirthdaySelects) {
|
||||||
birthdayMode = true;
|
birthdayMode = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (ageInput) break;
|
|
||||||
await sleep(100);
|
await sleep(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user