Fork me on GitHub
#fulcro
<
2019-11-06
>
tony.kay00:11:03

@boccato I played with cypress some more. I’m liking it. The async kb events are not done perfectly, so type() isn’t working right unless you set the delay rather high, but I found this workaround that does quite nicely, which you can add to the support/commands.js file:

const nativeInputValueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, 'value').set;

Cypress.Commands.add('fill', {
    prevSubject: 'element'
}, (subject, value) => {
    cy.wrap(subject).then((input) => {
        // get the DOM node
        const domnode = input[0];
        nativeInputValueSetter.call(domnode, value);
        domnode.dispatchEvent(new Event('change', {value: value, bubbles: true}));
    });
});

👍 4
tony.kay00:11:53

then you can use cy.get('#field').fill('some text') and there is no delay or screw up

adambrosio00:11:34

so how does it generate the tests you record... is it just javascript? or data?

tony.kay00:11:13

you don’t record, you write code (in js)

tony.kay00:11:27

but it’s pretty easy

adambrosio00:11:39

looking at the video on http://cypress.io it looked like it was recording your interactions

adambrosio00:11:23

never mind, on a second look it's recording the ui as it tests so you can view it after the fact

Adrian Smith09:11:37

Good morning, I have the Fulcro 3 starter template, I'm trying to create some documentation for hello world for my personal use here: https://adriansmith.io/ (images broken) but I can't figure out how to get a component to render hello world (in that starter template), additional details here: https://github.com/fulcrologic/fulcro-template/issues/7

Adrian Smith09:11:37

This is the furthest I can get, by copying the index.html from the workspaces directory to the main public folder and modifying the javascript script link to the compiled output

thheller10:11:05

@sfyire the template assumes you are using the backend described in the readme steps. so you should be accessing via localhost:3000 not the test server

Adrian Smith10:11:29

oh I see, thank you I'll retry later today

mping11:11:41

Hi all, I'm making an electron app that will require no backend. I just need a local db. What's the fulcro way of doing this? The docs kinda assume there's an api AFAIK

wilkerlucio11:11:02

@mping hello 🙂 the API can be local, the Fulcro template uses pathom in the backend, but you can also use pathom in the front-end, so you can write a parser in cljs and use that

mping12:11:03

@wilkerlucio olá 🙂 what do you mean as local api? I'll still have a bg process running in electron main, outside of renderer?

wilkerlucio12:11:49

it could use that, but could also live directly in the browser page, depends on how you want to design it

wilkerlucio12:11:09

when I think API for fulcro, I'm thinking this: you need something to process the EQL requests

wilkerlucio12:11:46

Fulcro, when it needs to communicate with the outside world, it always uses EQL, so what you need is a fulcro remote that can fulfill those queries

wilkerlucio12:11:00

in the default template, this is fulfilled by sending an HTTP request with the EQL request in it

wilkerlucio12:11:19

but if you write a local pathom parser, it can fulfill the EQL request directly there, makes sense?

mping12:11:52

Yes it does, I just need to map the fulcro terminology to my head

Adrian Smith19:11:39

What does -Dtrace do?

Adrian Smith19:11:48

hmm seems ok without anything but the dev alias, I assume this means guardrails is off not sure what -Dtrace is though

Björn Ebbinghaus19:11:04

From the template README: > The -J-Dtrace adds a JVM argument that will enable performance tracing for Fulcro Inspect’s network tab so you can see how your resolvers and mutations are performing.