Subversion Repositories SmartDukaan

Rev

Rev 37432 | Rev 37434 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37432 Rev 37433
Line 154... Line 154...
154
                                    actionProvider.release().perform();
154
                                    actionProvider.release().perform();
155
                                    LOGGER.info("Move click performed (main {}px)", moveByOffset);
155
                                    LOGGER.info("Move click performed (main {}px)", moveByOffset);
156
                                    try {
156
                                    try {
157
                                        try {
157
                                        try {
158
                                            wait5Sec.until(ExpectedConditions.visibilityOfElementLocated(By.className("dx_captcha_basic_bar-inform")));
158
                                            wait5Sec.until(ExpectedConditions.visibilityOfElementLocated(By.className("dx_captcha_basic_bar-inform")));
-
 
159
                                            // realme logs the widget's own verdict here and oppo did not,
-
 
160
                                            // which is why realme's failures name POSITION_MISMATCH and
-
 
161
                                            // oppo's 85% say nothing at all. Same line, oppo's variables.
159
                                            LOGGER.warn("Failed = " + counter);
162
                                            LOGGER.warn("Failed = {} (captcha said: {})", counter, captchaSignal(driver));
160
                                        } catch (Exception notFailedException) {
163
                                        } catch (Exception notFailedException) {
161
                                            LOGGER.info("Success  at attempt " + counter);
164
                                            LOGGER.info("Success  at attempt " + counter);
162
 
165
 
163
                                            // Read the JSON the page itself received rather than the
166
                                            // Read the JSON the page itself received rather than the
164
                                            // rendered text. The DOM value is built from two text nodes -- the
167
                                            // rendered text. The DOM value is built from two text nodes -- the
Line 352... Line 355...
352
     *
355
     *
353
     * Aim to close about half the gap: the piece travels roughly ASSUMED_RATIO px per
356
     * Aim to close about half the gap: the piece travels roughly ASSUMED_RATIO px per
354
     * slider px, so nudge ~= gap / (2 * ratio), clamped. The real ratio is still derived
357
     * slider px, so nudge ~= gap / (2 * ratio), clamped. The real ratio is still derived
355
     * from the measurement; this only sizes the probe.
358
     * from the measurement; this only sizes the probe.
356
     */
359
     */
-
 
360
    /*
-
 
361
     * These are OPPO's tuning values and are deliberately independent of realme's.
-
 
362
     * The two classes drive the same dingxiang widget but convert very differently
-
 
363
     * (oppo ~12%, realme ~60% of completed drags), so a change proven on one is NOT
-
 
364
     * evidence for the other. Tune and measure them separately.
-
 
365
     *
-
 
366
     * 1.7 was a guess carried over from a single hand measurement. Measured over 3,694
-
 
367
     * real oppo calibrations in production the ratio is 0.67 (realme's is 0.70, on its
-
 
368
     * own 1,683). At 1.7 the probe closes about a fifth of the gap instead of the half
-
 
369
     * it is meant to, so the ratio is derived from a needlessly small, noisy sample.
-
 
370
     */
357
    private static final double ASSUMED_RATIO = 1.7;
371
    private static final double ASSUMED_RATIO = 0.67;
358
    private static final int MIN_NUDGE = 10;
372
    private static final int MIN_NUDGE = 10;
359
    private static final int MAX_NUDGE = 60;
373
    private static final int MAX_NUDGE = 60;
360
    private static final double ALIGNED_PX = 2.0;
374
    private static final double ALIGNED_PX = 2.0;
361
 
375
 
362
    private static int nudgeFor(double gap) {
376
    private static int nudgeFor(double gap) {