// Copyright (C) 2025 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

import * as names from 'names.js';

function main() {
    startApplication("keypadnavigation");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 0);
    scrollTo(waitForObject(names.scrollAreaHorizontalSliderQSlider), 10);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Left>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 9);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Left>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 8);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Left>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 7);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Left>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 6);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Left>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 5);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Left>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 4);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Left>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 3);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Left>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 2);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Left>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 1);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Left>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 0);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Left>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 0);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Right>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 1);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Right>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 2);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Right>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 3);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Right>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 4);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Right>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 5);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Right>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 6);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Right>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 7);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Right>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 8);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Right>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 9);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Right>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 10);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Right>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 10);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Right>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 10);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Down>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 9);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Down>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 8);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Down>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 7);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Down>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 6);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Down>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 5);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Down>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 4);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Down>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 3);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Down>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 2);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Down>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 1);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Down>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 0);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Down>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 0);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Down>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 0);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Up>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 1);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Up>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 2);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Up>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 3);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Up>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 4);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Up>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 5);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Up>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 6);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Up>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 7);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Up>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 8);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Up>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 9);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Up>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 10);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Up>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 10);
    type(waitForObject(names.scrollAreaHorizontalSliderQSlider), "<Up>");
    test.compare(waitForObjectExists(names.scrollAreaHorizontalSliderQSlider).sliderPosition, 10);
}
