Porting pure webdriver based test to CodeceptJs test adds URL encoding
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 32/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, node.js
- Lĩnh vực
- testing-qa
Hướng nghiên cứu
Bắt đầu với lệnh gọi I.amOnPage trong test được cung cấp và các thiết lập helper của WebDriver trong cấu hình; so sánh hành vi điều hướng của nó với ví dụ driver.get của Selenium. Theo dõi cách fragment của URL được truyền và mã hóa, sau đó thêm một regression test sử dụng URL được báo cáo. Hoàn tất khi CodeceptJS giữ nguyên hành vi URL được test webdriver ban đầu mong đợi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
}
}
}```
- Ngôn ngữ chính
- JavaScript
- Star
- 4.2k
- Fork
- 756
- Merge trung bình
- 2 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 16
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của codeceptjs/CodeceptJS
-
stale
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
codeceptjs/CodeceptJS#5420 · 1 bình luận ·
-
stale
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
codeceptjs/CodeceptJS#5358 · 1 bình luận ·
-
stale
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
codeceptjs/CodeceptJS#4958 · 10 bình luận · 2 reaction ·
-
stale
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
codeceptjs/CodeceptJS#4778 · 3 bình luận ·
-
stale
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
codeceptjs/CodeceptJS#5618 · 1 bình luận ·
Tất cả issue của codeceptjs/CodeceptJS
Issue tương tự
-
ai-observability bug team/ai-observability
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
AllTheMods/ATM-10-L#19 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
SignalK/n2k-signalk#345 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
JuliaPluto/PlutoPlotly.jl#72 ·