我正在努力尝试在var id = $(this).attr("data-id")
$.ajax({
type: "GET",
url: "XTM307.aspx/GetPart?id=" + id,
contentType: "application/json",
dataType: "json",
success: function (response) {
}
});
中运行wdio
测试,错误是它无法在当前设置下找到Docker
docker-compose.yml
Chrome binary
Dockerfile
version: "3.7"
services:
code:
image: my-image
build:
dockerfile: ./Dockerfile
context: .
volumes:
- .:/app
depends_on:
- "selenium"
command: /bin/bash -c "cd app; npm test"
selenium:
image: selenium/standalone-chrome
volumes:
- /dev/shm:/dev/shm
ports:
- "4444:4444"
wdio.conf.js
FROM node:10.15.3
ADD . /app
WORKDIR /app
RUN apt update && apt install default-jre -y
运行...
exports.config = {
runner: 'local',
// host: process.env.HOST,
host: 'selenium',
port: 4444,
...
docker-compose up
答案 0 :(得分:0)
必须按如下所示编辑docker-compose.yml:
version: "3.7"
services:
code:
network_mode: host
image: my-image
build:
dockerfile: ./Dockerfile
context: .
volumes:
- .:/app
depends_on:
- "selenium"
command: /bin/bash -c "cd app; npm test"
selenium:
network_mode: host
image: selenium/standalone-chrome:3.141.59-oxygen
volumes:
- /dev/shm:/dev/shm
```