<commit_before>import {expect} from '@playwright/test';
import {ConstantHelper, test} from '@umbraco/playwright-testhelpers';

test.describe('Relation Types', () => {

  test.beforeEach(async ({page, umbracoApi}) => {
    // TODO: REMOVE THIS WHEN SQLITE IS FIXED
    // Wait so we don't bombard the API
    await page.waitForTimeout(1000);
    await umbracoApi.login();
  });

  test('Create relation type', async ({page, umbracoApi, umbracoUi}) => {
    const name = "Test relation type";

    await umbracoApi.relationTypes.ensureNameNotExists(name);

    await umbracoUi.goToSection(ConstantHelper.sections.settings);
    await umbracoUi.waitForTreeLoad(ConstantHelper.sections.settings);

    await umbracoUi.clickElement(umbracoUi.getTreeItem("settings", ["Relation Types"]), {button: "right"});

    await umbracoUi.clickElement(umbracoUi.getContextMenuAction(ConstantHelper.actions.create));

    const form = await page.locator('form[name="createRelationTypeForm"]');
    
    await form.locator('input[name="relationTypeName"]').type(name);
    await form.locator('[name="relationType-direction"] input').first().click({force: true});
    await page.selectOption('select[name="relationType-parent"]', {label: "Document"});
    await page.selectOption('select[name="relationType-child"]', {label: "Media"});
    await form.locator('[name="relationType-isdependency"]').last().click({force: true});
    await form.locator('.btn-primary').click();
    
    await page.waitForNavigation();

    expect(page.url()).toContain("#/settings/relationTypes/edit/");

    //Clean up
    await umbracoApi.relationTypes.ensureNameNotExists(name);
  });
});<commit_msg>Added proper save assert instead of checking on the route<commit_after>import {expect} from '@playwright/test';
import {ConstantHelper, test} from '@umbraco/playwright-testhelpers';

test.describe('Relation Types', () => {

  test.beforeEach(async ({page, umbracoApi}) => {
    // TODO: REMOVE THIS WHEN SQLITE IS FIXED
    // Wait so we don't bombard the API
    await page.waitForTimeout(1000);
    await umbracoApi.login();
  });

  test('Create relation type', async ({page, umbracoApi, umbracoUi}) => {
    const name = "Test relation type";

    await umbracoApi.relationTypes.ensureNameNotExists(name);

    await umbracoUi.goToSection(ConstantHelper.sections.settings);
    await umbracoUi.waitForTreeLoad(ConstantHelper.sections.settings);

    await umbracoUi.clickElement(umbracoUi.getTreeItem("settings", ["Relation Types"]), {button: "right"});

    await umbracoUi.clickElement(umbracoUi.getContextMenuAction(ConstantHelper.actions.create));

    const form = await page.locator('form[name="createRelationTypeForm"]');
    
    await form.locator('input[name="relationTypeName"]').type(name);
    await form.locator('[name="relationType-direction"] input').first().click({force: true});
    await page.selectOption('select[name="relationType-parent"]', {label: "Document"});
    await page.selectOption('select[name="relationType-child"]', {label: "Media"});
    await form.locator('[name="relationType-isdependency"]').last().click({force: true});
    await form.locator('.btn-primary').click();
    await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save))
    await umbracoUi.isSuccessNotificationVisible();
    
    //Clean up
    await umbracoApi.relationTypes.ensureNameNotExists(name);
  });
});
{'fraction_non_alphanumeric': 0.15420697742597478, 'fraction_numerical': 0.0023453532688361184, 'mean_word_length': 5.283609576427256, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '3232590', 'n_tokens_mistral': 1040, 'n_tokens_neox': 1038, 'n_words': 186}