小编use*_*962的帖子

Viewing The Interactive Cypress Test Runner In Docker On Linux

I'm trying to see Cypress in interactive mode when the Cypress tests are running in a docker container. This article explains how do it on Mac - https://www.cypress.io/blog/2019/05/02/run-cypress-with-a-single-docker-command/#Interactive-mode. I cannot get it to work however on my new linux mint OS install.

Following the article, I have set -

$ IP=172.17.0.1
$ xhost + $IP
$ export DISPLAY=172.17.0.1:0
Run Code Online (Sandbox Code Playgroud)

Which is the IP address on my local host machine on the Docker default bridge network.

This is my only set …

linux docker cypress

5
推荐指数
2
解决办法
3444
查看次数

有没有办法优雅地使用 django 模型作为输入对象类型?

说我有,

class PersonNode(DjangoObjectType):
    class Meta:
        model = Person
        fields = ('first_name', 'last_name', 'age',
                  'sex', 'alive', 'unique_identifier',)
        filter_fields = ('first_name', 'last_name', 'age',
                         'sex', 'alive', 'unique_identifier',)
        interfaces = (graphene.relay.Node,)

class PersonNodeInput(graphene.InputObjectType):
    first_name = graphene.String()
    last_name = graphene.String()
    # rest of person model fields

class Valid(graphene.ObjectType):
    ok = graphene.Boolean()

class Query(graphene.ObjectType):
    validate_person = graphene.Field(Valid, args={
                                     "data": PersonNodeInput()})
    person = graphene.relay.Node.Field(PersonNode)
    all_people = DjangoFilterConnectionField(PersonNode)

    def resolve_validate_person(root, info, data):
        print("resolve validate person")
        return Valid(ok=True)
Run Code Online (Sandbox Code Playgroud)

是否可以避免写出PersonNodeInput?如果您可以对“DjangoInputObjectType”之类的内容进行子类化并在 Meta 属性中指定所需的模型和字段,那就太好了。

graphene-django

5
推荐指数
1
解决办法
1317
查看次数

标签 统计

cypress ×1

docker ×1

graphene-django ×1

linux ×1