<commit_before>Feature('Selected Name');

Scenario('user edits name details for unprotected', function* (I) {
  I.login();
  const newUnprotectedName = yield I.createFakeName();
  I.createNewUnprotectedName(newUnprotectedName);

  const editName = yield I.createFakeName();
  I.waitForVisible('#selectedName');
  within('#selectedName', () => {
    I.click('#editName');
    I.fillField('firstName', editName.firstName);
    I.fillField('lastName', editName.lastName);
    I.fillField('phone', editName.phone);
    I.click('#standardSubmit');
  });

  I.waitToHide('.names__overlay');
  I.waitForElement('#unprotectedNamesList');
  I.waitForVisible('#appNotification');
  within('#unprotectedNamesList .name:nth-of-type(1)', () => {
    I.see(editName.firstName);
    I.see(editName.lastName);
    I.see(editName.phone);
  });
});

Scenario('user edits company details for unprotected', function* (I) {
  I.login();
  const newUnprotectedName = yield I.createFakeName();
  I.createNewUnprotectedName(newUnprotectedName);

  const editCompany = yield I.createFakeCompany();
  I.waitForVisible('#selectedName');
  within('#selectedName', () => {
    I.click('#editCompany');
    I.fillField('name', editCompany.name);
    I.fillField('phone', editCompany.address);
    I.fillField('address', editCompany.phone);
    I.click('#standardSubmit');
  });

  I.waitToHide('.names__overlay');
  I.waitForElement('#unprotectedNamesList');
  I.waitForVisible('#appNotification');
  within('#unprotectedNamesList .name:nth-of-type(1)', () => {
    I.see(editCompany.name);
  });

  within('#selectedName', () => {
    I.see(editCompany.name);
    I.see(editCompany.address);
    I.see(editCompany.phone);
  });
});

Scenario('user edits name details for protected', function* (I) {
  I.login();
  const newProtectedName = yield I.createFakeName();
  I.createProtectedName(newProtectedName);

  const editName = yield I.createFakeName();
  I.waitForVisible('#selectedName');
  within('#selectedName', () => {
    I.click('#editName');
    I.fillField('phone', editName.phone);
    I.click('#standardSubmit');
  });

  I.waitToHide('.names__overlay');
  I.waitForElement('#protectedNamesList');
  I.waitForVisible('#appNotification');
  within('#protectedNamesList .name:nth-of-type(1)', () => {
    I.see(editName.phone);
  });
});

Scenario('user edits company details for protected', function* (I) {
  I.login();
  const newProtectedName = yield I.createFakeName();
  I.createProtectedName(newProtectedName);

  const editCompany = yield I.createFakeCompany();
  I.waitForVisible('#selectedName');
  within('#selectedName', () => {
    I.click('#editCompany');
    I.fillField('name', editCompany.name);
    I.fillField('phone', editCompany.address);
    I.fillField('address', editCompany.phone);
    I.click('#standardSubmit');
  });

  I.waitToHide('.names__overlay');
  I.waitForElement('#protectedNamesList');
  I.waitForVisible('#appNotification');
  within('#protectedNamesList .name:nth-of-type(1)', () => {
    I.see(editCompany.name);
  });

  within('#selectedName', () => {
    I.see(editCompany.name);
    I.see(editCompany.address);
    I.see(editCompany.phone);
  });
});

Scenario('user edits name details for met with protected', function* (I) {
  I.login();
  const newMetWithProtectedName = yield I.createFakeName();
  I.createMetWithProtectedName(newMetWithProtectedName);

  const editName = yield I.createFakeName();
  I.waitForVisible('#selectedName');
  within('#selectedName', () => {
    I.click('#editName');
    I.fillField('phone', editName.phone);
    I.click('#standardSubmit');
  });

  I.waitToHide('.names__overlay');
  I.waitForElement('#metWithProtectedNamesList');
  I.waitForVisible('#appNotification');
  within('#metWithProtectedNamesList .name:nth-of-type(1)', () => {
    I.see(editName.phone);
  });
});

Scenario('user edits company details for met with protected', function* (I) {
  I.login();
  const newMetWithProtectedName = yield I.createFakeName();
  I.createMetWithProtectedName(newMetWithProtectedName);

  const editCompany = yield I.createFakeCompany();
  I.waitForVisible('#selectedName');
  within('#selectedName', () => {
    I.click('#editCompany');
    I.fillField('name', editCompany.name);
    I.fillField('phone', editCompany.address);
    I.fillField('address', editCompany.phone);
    I.click('#standardSubmit');
  });

  I.waitToHide('.names__overlay');
  I.waitForElement('#metWithProtectedNamesList');
  I.waitForVisible('#appNotification');
  within('#metWithProtectedNamesList .name:nth-of-type(1)', () => {
    I.see(editCompany.name);
  });

  within('#selectedName', () => {
    I.see(editCompany.name);
    I.see(editCompany.address);
    I.see(editCompany.phone);
  });
});

Scenario('user edits name details for client', function* (I) {
  I.login();
  const newClient = yield I.createFakeName();
  I.createClient(newClient);

  const editName = yield I.createFakeName();
  I.waitForVisible('#selectedName');
  within('#selectedName', () => {
    I.click('#editName');
    I.fillField('phone', editName.phone);
    I.click('#standardSubmit');
  });

  I.waitToHide('.names__overlay');
  I.waitForElement('#clientNamesList');
  I.waitForVisible('#appNotification');
  within('#clientNamesList .name:nth-of-type(1)', () => {
    I.see(editName.phone);
  });
});

Scenario('user edits company details for client', function* (I) {
  I.login();
  const newClient = yield I.createFakeName();
  I.createClient(newClient);

  const editCompany = yield I.createFakeCompany();
  I.waitForVisible('#selectedName');
  within('#selectedName', () => {
    I.click('#editCompany');
    I.fillField('name', editCompany.name);
    I.fillField('phone', editCompany.address);
    I.fillField('address', editCompany.phone);
    I.click('#standardSubmit');
  });

  I.waitToHide('.names__overlay');
  I.waitForElement('#clientNamesList');
  I.waitForVisible('#appNotification');
  within('#clientNamesList .name:nth-of-type(1)', () => {
    I.see(editCompany.name);
  });

  within('#selectedName', () => {
    I.see(editCompany.name);
    I.see(editCompany.address);
    I.see(editCompany.phone);
  });
});<commit_msg>trying to make sele cted name tests more stable by more precise selector<commit_after>Feature('Selected Name');

Scenario('user edits name details for unprotected', function* (I) {
  I.login();
  const newUnprotectedName = yield I.createFakeName();
  I.createNewUnprotectedName(newUnprotectedName);

  const editName = yield I.createFakeName();
  I.waitForVisible('#selectedName');
  within('#selectedName', () => {
    I.click('#editName');
    I.fillField('firstName', editName.firstName);
    I.fillField('lastName', editName.lastName);
    I.fillField('phone', editName.phone);
    I.click('#standardSubmit[type="submit"]');
  });

  I.waitToHide('.names__overlay');
  I.waitForElement('#unprotectedNamesList');
  I.waitForVisible('#appNotification');
  within('#unprotectedNamesList .name:nth-of-type(1)', () => {
    I.see(editName.firstName);
    I.see(editName.lastName);
    I.see(editName.phone);
  });
});

Scenario('user edits company details for unprotected', function* (I) {
  I.login();
  const newUnprotectedName = yield I.createFakeName();
  I.createNewUnprotectedName(newUnprotectedName);

  const editCompany = yield I.createFakeCompany();
  I.waitForVisible('#selectedName');
  within('#selectedName', () => {
    I.click('#editCompany');
    I.fillField('name', editCompany.name);
    I.fillField('phone', editCompany.address);
    I.fillField('address', editCompany.phone);
    I.click('#standardSubmit[type="submit"]');
  });

  I.waitToHide('.names__overlay');
  I.waitForElement('#unprotectedNamesList');
  I.waitForVisible('#appNotification');
  within('#unprotectedNamesList .name:nth-of-type(1)', () => {
    I.see(editCompany.name);
  });

  within('#selectedName', () => {
    I.see(editCompany.name);
    I.see(editCompany.address);
    I.see(editCompany.phone);
  });
});

Scenario('user edits name details for protected', function* (I) {
  I.login();
  const newProtectedName = yield I.createFakeName();
  I.createProtectedName(newProtectedName);

  const editName = yield I.createFakeName();
  I.waitForVisible('#selectedName');
  within('#selectedName', () => {
    I.click('#editName');
    I.fillField('phone', editName.phone);
    I.click('#standardSubmit[type="submit"]');
  });

  I.waitToHide('.names__overlay');
  I.waitForElement('#protectedNamesList');
  I.waitForVisible('#appNotification');
  within('#protectedNamesList .name:nth-of-type(1)', () => {
    I.see(editName.phone);
  });
});

Scenario('user edits company details for protected', function* (I) {
  I.login();
  const newProtectedName = yield I.createFakeName();
  I.createProtectedName(newProtectedName);

  const editCompany = yield I.createFakeCompany();
  I.waitForVisible('#selectedName');
  within('#selectedName', () => {
    I.click('#editCompany');
    I.fillField('name', editCompany.name);
    I.fillField('phone', editCompany.address);
    I.fillField('address', editCompany.phone);
    I.click('#standardSubmit[type="submit"]');
  });

  I.waitToHide('.names__overlay');
  I.waitForElement('#protectedNamesList');
  I.waitForVisible('#appNotification');
  within('#protectedNamesList .name:nth-of-type(1)', () => {
    I.see(editCompany.name);
  });

  within('#selectedName', () => {
    I.see(editCompany.name);
    I.see(editCompany.address);
    I.see(editCompany.phone);
  });
});

Scenario('user edits name details for met with protected', function* (I) {
  I.login();
  const newMetWithProtectedName = yield I.createFakeName();
  I.createMetWithProtectedName(newMetWithProtectedName);

  const editName = yield I.createFakeName();
  I.waitForVisible('#selectedName');
  within('#selectedName', () => {
    I.click('#editName');
    I.fillField('phone', editName.phone);
    I.click('#standardSubmit[type="submit"]');
  });

  I.waitToHide('.names__overlay');
  I.waitForElement('#metWithProtectedNamesList');
  I.waitForVisible('#appNotification');
  within('#metWithProtectedNamesList .name:nth-of-type(1)', () => {
    I.see(editName.phone);
  });
});

Scenario('user edits company details for met with protected', function* (I) {
  I.login();
  const newMetWithProtectedName = yield I.createFakeName();
  I.createMetWithProtectedName(newMetWithProtectedName);

  const editCompany = yield I.createFakeCompany();
  I.waitForVisible('#selectedName');
  within('#selectedName', () => {
    I.click('#editCompany');
    I.fillField('name', editCompany.name);
    I.fillField('phone', editCompany.address);
    I.fillField('address', editCompany.phone);
    I.click('#standardSubmit[type="submit"]');
  });

  I.waitToHide('.names__overlay');
  I.waitForElement('#metWithProtectedNamesList');
  I.waitForVisible('#appNotification');
  within('#metWithProtectedNamesList .name:nth-of-type(1)', () => {
    I.see(editCompany.name);
  });

  within('#selectedName', () => {
    I.see(editCompany.name);
    I.see(editCompany.address);
    I.see(editCompany.phone);
  });
});

Scenario('user edits name details for client', function* (I) {
  I.login();
  const newClient = yield I.createFakeName();
  I.createClient(newClient);

  const editName = yield I.createFakeName();
  I.waitForVisible('#selectedName');
  within('#selectedName', () => {
    I.click('#editName');
    I.fillField('phone', editName.phone);
    I.click('#standardSubmit[type="submit"]');
  });

  I.waitToHide('.names__overlay');
  I.waitForElement('#clientNamesList');
  I.waitForVisible('#appNotification');
  within('#clientNamesList .name:nth-of-type(1)', () => {
    I.see(editName.phone);
  });
});

Scenario('user edits company details for client', function* (I) {
  I.login();
  const newClient = yield I.createFakeName();
  I.createClient(newClient);

  const editCompany = yield I.createFakeCompany();
  I.waitForVisible('#selectedName');
  within('#selectedName', () => {
    I.click('#editCompany');
    I.fillField('name', editCompany.name);
    I.fillField('phone', editCompany.address);
    I.fillField('address', editCompany.phone);
    I.click('#standardSubmit[type="submit"]');
  });

  I.waitToHide('.names__overlay');
  I.waitForElement('#clientNamesList');
  I.waitForVisible('#appNotification');
  within('#clientNamesList .name:nth-of-type(1)', () => {
    I.see(editCompany.name);
  });

  within('#selectedName', () => {
    I.see(editCompany.name);
    I.see(editCompany.address);
    I.see(editCompany.phone);
  });
});
{'fraction_non_alphanumeric': 0.18526517878569715, 'fraction_numerical': 0.0012798976081913446, 'mean_word_length': 4.9335548172757475, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 43, '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': '1335392', 'n_tokens_mistral': 4009, 'n_tokens_neox': 3969, 'n_words': 580}