<commit_before>// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import {beforeEach} from 'mocha';

import {goToResource, timeout} from '../../shared/helper.js';
import {describe, it} from '../../shared/mocha-extensions.js';
import {assertSelectedNodeClasses, toggleClassesPane, toggleClassesPaneCheckbox, typeInClassesPaneInput} from '../helpers/elements-helpers.js';

describe('The Classes pane', async () => {
  beforeEach(async function() {
    await goToResource('elements/simple-styled-page.html');
    await toggleClassesPane();
  });

  // Flaky on Linux
  it.skipOnPlatforms(['linux'], '[crbug.com/1184627]: can add a class to the element', async () => {
    await typeInClassesPaneInput('foo');
    await assertSelectedNodeClasses(['foo']);
  });

  // Flaky on Linux
  it.skipOnPlatforms(['linux'], '[crbug.com/1184627]: can add multiple classes at once', async () => {
    await typeInClassesPaneInput('foo bar baz');
    await assertSelectedNodeClasses(['foo', 'bar', 'baz']);
  });

  it('can toggle classes', async () => {
    await typeInClassesPaneInput('on off');
    await assertSelectedNodeClasses(['on', 'off']);

    await toggleClassesPaneCheckbox('off');
    await assertSelectedNodeClasses(['on']);

    await toggleClassesPaneCheckbox('off');
    await toggleClassesPaneCheckbox('on');
    await assertSelectedNodeClasses(['off']);
  });

  // Flaky on Linux
  it.skipOnPlatforms(['linux'], '[crbug.com/1184627]: removes the previewed classes on ESC', async () => {
    // Allow win64 bot to settle.
    await timeout(500);
    await typeInClassesPaneInput('foo');
    await typeInClassesPaneInput('bar', 'Escape', false);
    await typeInClassesPaneInput('baz');

    await assertSelectedNodeClasses(['foo', 'baz']);
  });
});<commit_msg>Tentatively re enable classes-pane e2e test<commit_after>// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import {beforeEach} from 'mocha';

import {goToResource, timeout} from '../../shared/helper.js';
import {describe, it} from '../../shared/mocha-extensions.js';
import {assertSelectedNodeClasses, toggleClassesPane, toggleClassesPaneCheckbox, typeInClassesPaneInput} from '../helpers/elements-helpers.js';

describe('The Classes pane', async () => {
  beforeEach(async function() {
    await goToResource('elements/simple-styled-page.html');
    await toggleClassesPane();
  });

  it('can add a class to the element', async () => {
    await typeInClassesPaneInput('foo');
    await assertSelectedNodeClasses(['foo']);
  });

  it('can add multiple classes at once', async () => {
    await typeInClassesPaneInput('foo bar');
    await assertSelectedNodeClasses(['foo', 'bar']);
  });

  it('can toggle classes', async () => {
    await typeInClassesPaneInput('on off');
    await assertSelectedNodeClasses(['on', 'off']);

    await toggleClassesPaneCheckbox('off');
    await assertSelectedNodeClasses(['on']);

    await toggleClassesPaneCheckbox('off');
    await toggleClassesPaneCheckbox('on');
    await assertSelectedNodeClasses(['off']);
  });

  it('removes the previewed classes on ESC', async () => {
    // Allow win64 bot to settle.
    await timeout(200);
    await typeInClassesPaneInput('foo');
    await typeInClassesPaneInput('bar', 'Escape', false);
    await typeInClassesPaneInput('baz');

    await assertSelectedNodeClasses(['foo', 'baz']);
  });
});
{'fraction_non_alphanumeric': 0.14956667598546267, 'fraction_numerical': 0.01118255521386637, 'mean_word_length': 4.538699690402477, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5922359', 'n_tokens_mistral': 1039, 'n_tokens_neox': 1020, 'n_words': 280}