Porting pure webdriver based test to CodeceptJs test adds URL encoding
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 32/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- javascript, node.js
- Área
- testing-qa
Línea de trabajo
Comienza con la llamada I.amOnPage en la prueba proporcionada y la configuración auxiliar de WebDriver en la configuración; compara su comportamiento de navegación con el ejemplo driver.get de Selenium. Rastrea cómo se pasa y codifica el fragmento de la URL y, a continuación, añade una prueba de regresión usando la URL indicada. El trabajo estará terminado cuando CodeceptJS preserve el comportamiento de la URL esperado por la prueba original de webdriver.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What are you trying to achieve?
call this url by selenium via webdriver:
What do you get instead?
but this got sent instead (|, { and } are got encoded):
Provide test source code if related
Scenario('change the company', async ({ I }) => {
I.amOnPage('https://host.docker.internal:8000/payroll/#company/1-250|project|projectViewState/{%22type%22:%22event%22,%22date_range%22:%221%20WEEK%22,%22eventid%22:1,%22eventdb%22:250,%22regularcheckin%22:true}|listViewOpen/2-250');
let url = await I.grabCurrentUrl();
console.log(`Current URL is [${url}]`);
})```
the original test works well
````js
// Generated by Selenium IDE
const { Builder, By, Key, until} = require('selenium-webdriver')
const chrome = require('selenium-webdriver/chrome')
const logging = require('selenium-webdriver/lib/logging')
const assert = require('assert')
const BASEURL = 'https://host.docker.internal:8000/payroll/';
describe('Payroll', function() {
this.timeout(30000)
let driver
let options
beforeEach(async function() {
builder = new Builder();
options = (new chrome.Options()).setAcceptInsecureCerts(true);
prefs = new logging.Preferences();
prefs.setLevel(logging.Type.BROWSER, logging.Level.ALL);
options.setLoggingPrefs(prefs);
driver = await builder.forBrowser('chrome').usingServer('http://localhost:4444/wd/hub').setChromeOptions(options).build()
vars = {}
})
afterEach(async function() {
//await driver.manage().logs().get(logging.Type.BROWSER).then((logs) => console.log(logs))
await driver.takeScreenshot().then((image) => require('fs').writeFileSync('captured_image_3.png', image, 'base64'));
await driver.quit();
})
async function openBrowser(driver, url) {
await driver.get(BASEURL + url);
let username = await driver.wait(until.elementLocated(By.id("login-username-inputEl")));
username.sendKeys("arthur");
let password = await driver.wait(until.elementLocated(By.id("login-password-inputEl")));
password.sendKeys("hwzsyx5h$");
let loginButton = await driver.wait(until.elementLocated(By.id("login-button")));
loginButton.click();
await driver.manage().window().setRect(1924, 768)
}
it('open and save the contract editor', async function() {
await openBrowser(driver, "#company/1-250|project|projectViewState/{%22type%22:%22event%22,%22date_range%22:%221%20WEEK%22,%22eventid%22:1,%22eventdb%22:250,%22regularcheckin%22:true}|listViewOpen/2-250")
await driver.wait(until.elementLocated(By.id("firstname-inputEl")), NaN)
await driver.findElement(By.id("open-editor")).click()
await driver.findElement(By.id("overtimeunitAsMinutes-inputEl")).click()
await driver.findElement(By.id("overtimeunitAsMinutes-inputEl")).sendKeys("30")
await driver.findElement(By.id("save-editor")).click()
})
})
Details
- CodeceptJS version: 3.13
- NodeJS Version:16.9.1
- Operating System: WSL Ubuntu 20
- webdriverio: 6.12.1
- Configuration file: ?
exports.config = {
tests: './tests/acceptance/codeceptjs/*.co.js',
output: './output',
helpers: {
WebDriver: {
url: 'https://localhost',
browser: 'chrome',
host: '127.0.0.1',
port: 4444,
restart: true,
windowSize: '1920x1680',
smartWait: 5000,
desiredCapabilities: {
chromeOptions: {
args: [ /*"--headless",*/ "--disable-gpu", "--no-sandbox", "--ignore-certificate-errors" ]
}
}
}
},
include: {
I: './steps_file.js'
},
bootstrap: null,
mocha: {},
name: 'payroll',
plugins: {
pauseOnFail: {},
retryFailedStep: {
enabled: true
},
tryTo: {
enabled: true
},
screenshotOnFail: {
enabled: true
}
}
}```
- Lenguaje dominante
- JavaScript
- Estrellas
- 4.2k
- Forks
- 756
- Merge medio
- 2 d 9 h
- PR fusionados (30 d)
- 16
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de codeceptjs/CodeceptJS
-
stale
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
codeceptjs/CodeceptJS#5420 · 1 comentario ·
-
stale
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
codeceptjs/CodeceptJS#5358 · 1 comentario ·
-
stale
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
codeceptjs/CodeceptJS#4958 · 10 comentarios · 2 reacciones ·
-
stale
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
codeceptjs/CodeceptJS#4778 · 3 comentarios ·
-
stale
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
codeceptjs/CodeceptJS#5618 · 1 comentario ·
Todos los issues de codeceptjs/CodeceptJS
Issues similares
-
curation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
amponce/archive-movie-browser#186 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
clerk/javascript#9852 ·
-
bug p1 tools
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
HarperFast/skills#96 ·
-
factory-active factory-automatic task-bug-reproduction-cannot-reproduce task-identify-harness-labels-done task-identify-issue-type-done
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100