(async function() { const webdriver = await require('selenium-webdriver'); const By = webdriver.By; const until = webdriver.until; let driver = await new webdriver.Builder().forBrowser('edge').build(); try { await driver.findElement(By.linkText('Workloads')).click(); await driver.wait(until.elementLocated(By.linkText('pods')), 10000).click(); await driver.findElement(By.linkText('Pods')).click(); await driver.wait(until.elementLocated(By.linkText('pod-synthetic-pvc')), 10000).click(); await driver.findElement(By.linkText('pod-synthetic-pvc')).click(); await driver.wait(until.elementLocated(By.linkText('YAML')), 10000); await driver.findElement(By.linkText('YAML')).click(); await driver.wait(until.elementLocated(By.css('.yaml-editor')), 10000); const currentYaml = await yamlEditor.getAttribute('value'); const keyToUpdate1 = 'httpd'; const newValue1 = 'pod-synthetic-pvc'; const regex1 = new RegExp(`(${keyToUpdate1}:\\s*`, 'i'); const newYaml1 = currentYaml.replace(regex1, `$1${newValue1}`); await yamlEditor.clear(); await yamlEditor.sendKeys(newYaml1); const saveButton = await browser.findElement(By.css('.save-button')); await saveButton.click(); const successMessage = await browser.wait(until.elementLocated(By.css('.success-message')), 10000); assert.isTrue(await successMessage.isDisplayed(), 'Yaml modification was not successful'); } finally { await driver.quit(); } })();