Skip to content
Snippets Groups Projects
Commit c13dc700 authored by Stephen Mustgrave's avatar Stephen Mustgrave
Browse files

Test ONLY for 3432632

parent 0bb0da9f
Branches
Tags
No related merge requests found
Pipeline #159046 passed
Pipeline: drupal-3432632

#159047

    // This test is a duplicate of oliveroPrimaryTabsTest.js tagged for claro
    const primaryTabsWrapper = '[data-drupal-nav-primary-tabs]';
    const activeTab = '.tabs__tab.is-active';
    const inactiveTab = '.tabs__tab:not(.is-active)';
    const mobileToggle = `${activeTab} .tabs__trigger`;
    module.exports = {
    '@tags': ['core', 'claro'],
    before(browser) {
    browser
    .drupalInstall({
    setupFile:
    'core/tests/Drupal/TestSite/TestSiteOliveroInstallTestScript.php',
    installProfile: 'minimal',
    })
    .drupalCreateUser({
    name: 'user',
    password: '123',
    permissions: ['administer nodes'],
    })
    .drupalLogin({ name: 'user', password: '123' });
    browser.setWindowSize(1600, 800);
    },
    after(browser) {
    browser.drupalUninstall();
    },
    'Verify desktop primary tab display': (browser) => {
    browser
    .drupalRelativeURL('/node/1')
    .waitForElementVisible(primaryTabsWrapper)
    .assert.visible(activeTab)
    .assert.visible(inactiveTab)
    .assert.not.visible(mobileToggle);
    },
    'Verify mobile tab display and click functionality': (browser) => {
    browser
    .setWindowSize(699, 800)
    .drupalRelativeURL('/node/1')
    .waitForElementVisible(primaryTabsWrapper)
    .assert.visible(activeTab)
    .assert.not.visible(inactiveTab)
    .assert.visible(mobileToggle)
    .assert.attributeEquals(mobileToggle, 'aria-expanded', 'false')
    .click(mobileToggle)
    .waitForElementVisible(inactiveTab)
    .assert.attributeEquals(mobileToggle, 'aria-expanded', 'true')
    .click(mobileToggle)
    .waitForElementNotVisible(inactiveTab)
    .assert.attributeEquals(mobileToggle, 'aria-expanded', 'false');
    },
    };
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment