I've been hit by this iframe that breaks all my clicks and after adding { force: true } to it, it just moves to break should() assertions.
I don't know what this iframe is and it's not visible in the html when you are using the app. Is there a solution for this?
HTML of this button:
<button class="MuiButtonBase-root makeStyles-root-1080 makeStyles-sm-1082 makeStyles-sm-1303 makeStyles-ghost-1088 makeStyles-ghost-1308 makeStyles-button-1161 makeStyles-defaultState-1163 makeStyles-defaultState-1298" tabindex="0" type="button" aria-label="Lobby" data-cy="lobby-button" color="dark"><div class="makeStyles-contentWrapper-1093"><div class="makeStyles-content-1094 makeStyles-content-1310 makeStyles-content-1167"><span class="MuiBadge-root"><svg width="34" height="34" viewBox="0 0 34 34" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M21.7273 15.8571C23.6891 15.8571 25.2609 14.3257 25.2609 12.4286C25.2609 10.5314 23.6891 9 21.7273 9C19.7655 9 18.1818 10.5314 18.1818 12.4286C18.1818 14.3257 19.7655 15.8571 21.7273 15.8571ZM12.2727 15.8571C14.2345 15.8571 15.8064 14.3257 15.8064 12.4286C15.8064 10.5314 14.2345 9 12.2727 9C10.3109 9 8.72727 10.5314 8.72727 12.4286C8.72727 14.3257 10.3109 15.8571 12.2727 15.8571ZM12.2727 18.1429C9.51909 18.1429 4 19.48 4 22.1429V23.8571C4 24.4857 4.53182 25 5.18182 25H19.3636C20.0136 25 20.5455 24.4857 20.5455 23.8571V22.1429C20.5455 19.48 15.0264 18.1429 12.2727 18.1429ZM21.7273 18.1429C21.3845 18.1429 20.9945 18.1657 20.5809 18.2C20.6045 18.2114 20.6164 18.2343 20.6282 18.2457C21.9755 19.1943 22.9091 20.4629 22.9091 22.1429V23.8571C22.9091 24.2571 22.8264 24.6457 22.6964 25H28.8182C29.4682 25 30 24.4857 30 23.8571V22.1429C30 19.48 24.4809 18.1429 21.7273 18.1429Z" fill="currentColor"></path></svg><span class="MuiBadge-badge MuiBadge-anchorOriginTopRightRectangle MuiBadge-colorError MuiBadge-invisible">0</span></span></div></div><span class="MuiTouchRipple-root"></span></button>
And click is like this
cy.get('[data-cy="lobby-button"]').click();
This went away (was fixed) after commenting out
new ReactRefreshWebpackPlugin()
from webpack.config.js
Related
The bounty expires in 5 days. Answers to this question are eligible for a +50 reputation bounty.
Qoomit is looking for an answer from a reputable source.
I'm trying to accomplish this... in this example the green stroke is filled when the people selected (1), and the gray ones are the total of people (6)
other example is green stroke is filled (3) and total (6)
what I accomplished by now, it doesn't fill correctly,
const [personQuantity, setPersonQuantity] = useState(2)
const [payingFor, setPayingFor] = useState(1)
useEffect(() => {
let amountPerPerson = subtotal / personQuantity
let perPerson = amountPerPerson * payingFor
setPerPerson(perPerson)
if (personQuantity >= payingFor && personQuantity > 2) {
setActivate(true)
} else {
setActivate(false)
}
}, [personQuantity, payingFor])
const fillPercentage = (payingFor / personQuantity) * 100
return (
<>
<div className="h-20 w-20 ">
<svg className="circular-chart " viewBox="0 0 36 36">
<path
fill="none"
strokeWidth="4"
strokeDasharray={`${fillPercentage + 1},1`}
className="circle-bg bg-DARK_1 stroke-2 stroke-white"
d="M18 2.0845
a 15.9155 15.9155 0 0 1 0 31.831
a 15.9155 15.9155 0 0 1 0 -31.831"
/>
<path
strokeWidth="4"
strokeLinecap="round"
fill="none"
className="circle stroke-LIGHT_GREEN_1 transition-opacity delay-150 ease-in-out"
strokeDasharray={`${fillPercentage}, 100`}
d="M18 2.0845
a 15.9155 15.9155 0 0 1 0 31.831
a 15.9155 15.9155 0 0 1 0 -31.831"
/>
</svg>
</div>
as stated by enxaneta, you use path of 100 percent, so you should make the math so that the white draws the person's number separated by a gap percent space and the green fills the number of slots including intermediate spaces.
So assuming subtotal is the total number of persons and payingFor is the number of persons that should be green, we have :
let pathSize = 100
let gapSize = 1
let percentForOne = (pathSize / subtotal)
let greenedPercent = (percentForOne * payingFor) - gapSize
let notGreenedPercent = (percentForOne * (subtotal - payingFor)) + gapSize
so for white :
strokeDasharray={`${percentForOne} - ${gapSize},${gapSize}`}
then for green :
strokeDasharray={`${greenedPercent},${notGreenedPercent}`}
Please note that it will be incorrect with more than 100 persons because these would imply more than 100 gaps of 1 percent and negative space between them, so you should probably put the gapSize to 0 when subtotal is more than ~40 (esthetic value)
As a second note, while using a path to approximate a circle do work, I recommend using <circle cx="18" cy="18" r="15.9155" pathlength=100> and in both case you will need to rotate the figure by -90deg to achieve the vertical origin of the drawing transform: rotate(-90deg)
I did a demo on this codepen (with fixed values)
Original question:
Like in this picture but with a full triangle. And i need to be able to set the line x1,y1,x2,y2. Thanks!
this image (can't post it because I ain't got enogh reputation)
EDIT:
Im using "react-native-svg" here's what I have: a plain line :(
<Svg
height="1000"
width="1000"
>
<Line
x1={this.state.circle1.x}
y1={this.state.circle1.y}
x2={this.state.circle2.x}
y2={this.state.circle2.y}
stroke="#1abc9c"
strokeWidth="10"
/>
</Svg>
OK so I figure it out. This is probably a really bad implementation but it works. If someone can improve this answer please do:
<Svg
height="1000"
width="1000"
>
<G
rotation={(Math.atan2(this.state.point2.y - this.state.point1.y, this.state.point2.x - this.state.point1.x) * 180 / Math.PI)+45}
origin={`${this.state.point1.x}, ${this.state.point1.y}`}
>
<Path d={`M ${this.state.point1.x+8} ${this.state.point1.y+8} L ${this.state.point1.x-10} ${this.state.point1.y+10} L ${this.state.point1.x-8} ${this.state.point1.y-8} z`} fill="#1abc9c" stroke="#1abc9c" />
</G>
<G
rotation={(Math.atan2(this.state.point2.y - this.state.point1.y, this.state.point2.x - this.state.point1.x) * 180 / Math.PI)-135}
origin={`${this.state.point2.x}, ${this.state.point2.y}`}
>
<Path d={`M ${this.state.point2.x+8} ${this.state.point2.y+8} L ${this.state.point2.x-10} ${this.state.point2.y+10} L ${this.state.point2.x-8} ${this.state.point2.y-8} z`} fill="#1abc9c" stroke="#1abc9c" />
</G>
<Line
x1={this.state.point1.x}
y1={this.state.point1.y}
x2={this.state.point2.x}
y2={this.state.point2.y}
stroke="#1abc9c"
strokeWidth="10"
/>
</Svg>
I am trying to find out the XPATH. I am getting 30 matches for an element.
I tried using last(), position(), indexing[], child, parent, following:siblings, preceding:siblings, absolute XPATH is also not working, how to achieve this.
<div data-reactid=".0.0.1.0.0.1.$termsConditions-component.0.1.3.1.0.0.0.0.0.2.0:$5.5.0"><span class="cursor" data-reactid=".0.0.1.0.0.1.$termsConditions-component.0.1.3.1.0.0.0.0.0.2.0:$5.5.0.0"><svg viewBox="0 0 16 20" class="excel-document" style="background-image:none;background-position:0% 0%;display:inline;fill:#333;height:20px;width:16px;" data-reactid=".0.0.1.0.0.1.$termsConditions-component.0.1.3.1.0.0.0.0.0.2.0:$5.5.0.0.0"><path d="M2 0C.9 0 .01.9.01 2L0 18c0 1.1.89 2 1.99 2H14c1.1 0 2-.9 2-2V6l-6-6H2zm7 7V1.5L14.5 7H9zm-2.34 7.39l-3.45-5.1h2.73l2.1 3.42 2.175-3.42h2.58L9.36 14.405 13.095 20H10.29l-2.34-3.705L5.565 20h-2.64l3.735-5.61z" fill="#11764B" data-reactid=".0.0.1.0.0.1.$termsConditions-component.0.1.3.1.0.0.0.0.0.2.0:$5.5.0.0.0.0"></path></svg></span>
If you are trying to access the first matching element of given xpath, then wrap the entire xpath with () and then provide the index as shown below.
First matching element:
(//span[#class='cursor']//*[local-name()='svg'][#class='excel-document'])[1]
Following Element to the first-matching Element:
(//span[#class='cursor']//*[local-name()='svg'][#class='excel-document'])[1]/following-sibling::*
Last Element:
(//span[#class='cursor']//*[local-name()='svg'][#class='excel-document'])[last()]
I have no.of input field to edit by user. when user edits the value I am trying to re-wrap the array. when i do I would like to sort the values in controller. for that i do :
gridView.resort = function( ){
var start = new Date( );
gridView.gridData = $filter( 'orderBy')(slice, "mk", true );
}
when I console the filter I am getting like this:
119
gridData.js:22 879
gridData.js:22 470
gridData.js:22 420
gridData.js:22 392
gridData.js:22 347
gridData.js:22 293
gridData.js:22 234
gridData.js:22 170
gridData.js:22 120
But this is not work for me. when I change the value in one of the field with lesser number it sit on the first row, and it not sorted entire rows. any help?
on page load sortBy works for me :
apiService.generateData( ).then(function( data ){
var start = new Date( );
gridView.gridData = slice = $filter( 'orderBy')(data.splice( 0, 10 ), "mk");
});
Live Demo
(Enter some low values and see the out put )
As commented by #JB Nizet, you should consider using number instead of text.
there is still one way to deal with text which is invoking parseInt at ng-change event, but rememer that this will throw error when some thing else of number when you are typing(means you have to controll what can be typing in).
see the working example.
i have an old .BAS file that im trying to launch. I just need the program to work - i don't need to edit or do anything with the code. Does anybody know how to run it so i can see the program - its an old solitaire game i use for an example to show how the code is written. Can i run it through visual studio 2010 - if yes how? Or with program should i use to launch it?
Public Class Form1
SCREEN 9,0 'medium resolution'
FORGRUND%=4
BAGGRUND%=63
PILE%=9
DUG%=2
RUNDE%=1
ANTFLYT%=0
ANTKONGER%=0
KONGE13%=0
COLOR FORGRUND%,BAGGRUND%:CLS:KEY OFF
OPTION BASE 1 'laveste v‘rdi i tabeller s‘ttes til 1'
'*********************************************************'
' en lille startmelodi til at komme ignag med'
'*********************************************************'
'PLAY "mb o3 l8 ffffafffafdfe4.l8 eeeegeeedefed4" kattekilling
PLAY "mb o3 t255 l8 df+ga2df+ga2df+gl4af+df+e2l8f+f+ed4.df+4aaag2f+gl4af+ded2"
'*********************************************************'
'lav en konverteringstabel'
'*********************************************************'
GOSUB 2060
'*********************************************************'
'lav kasser s† de er flotte'
'*********************************************************'
GOSUB 2260
'*********************************************************'
'2 tabeller: randomizer, kort'
'randomizer initieres med vilk†rlige tal'
'*********************************************************'
GOSUB 2640
'*********************************************************'
'vi skal putte kortet p† rette plads p† bordet/sk‘rmen'
'*********************************************************'
GOSUB 2840
'*********************************************************'
'l‘s bord og flyt til sk‘rm'
'*********************************************************'
GOSUB 2950
'*********************************************************'
'pr›v at l‘se F fra sk‘rm'
'*********************************************************'
X=6
Y=3
FRASKARMX%=0 'initier fra-koordinat til brug ved mark›rbev‘gelser'
FRASKARMY%=0 'initier fra-koordinat til brug ved mark›rbev‘gelser'
COLOR PILE%,BAGGRUND%
LOCATE X,Y:PRINT CHR$(24)
COLOR FORGRUND%,BAGGRUND%
LOCATE 23,2:PRINT"V‘lg kort der skal flyttes ved at
taste "
FUNDET=1
WHILE FUNDET 's†l‘nge F ikke er indtastet'
FT$=INKEY$:IF FT$="" THEN LOCATE 1,72:PRINT TIME$:GOTO 510
IF LEN(FT$)=1 GOTO 630
IF LEN(FT$)=2 GOTO 560 'evt. mark›r bev‘gelse'
GOTO 680 'til endwhile'
'find mark›r-bev‘gelse'
FT$=RIGHT$(FT$,1)
IF ASC(FT$)=77 THEN GOSUB 1660 'pil til h›jre'
IF ASC(FT$)=75 THEN GOSUB 1750 'pil til venstre'
IF ASC(FT$)=72 THEN GOSUB 1850 'pil op'
IF ASC(FT$)=80 THEN GOSUB 1940 'pil ned'
GOTO 680
'find bogstav'
IF (FT$<>"f") AND (FT$<>"F") AND (FT$<>"a") AND (FT$<>"A") AND (FT$<>"N") AND
(FT$<>"n") AND (FT$<>"b") AND (FT$<>"B") GOTO 680
FUNDET=0
WEND
etc
VB2005 Express has an upgrade wizard. It opens automatically when you try to open a VB6 project.
This must be VB for DOS, (versions 1.0, not sure if 2.0 was ever made), its not qb since it has forms support (QB didnt have that) and its not Windows version since it has this SCREEN and COLOR statements (for console text resolution and colors) :
SCREEN 9,0 '**medium resolution' switch 0=nocolor 1=color
mode 9 with 0 no color
SCREEN 9: 640 x 350 graphics
80 x 25 or 80 x 43 text format, 8 x 14 or 8 x 8 character box
16 colors assigned to 4 attributes (64K adapter memory), or 64 colors assigned to 16 attributes (more than 64K adapter memory)
If 64K EGA adapter memory, 1 video memory page (0); otherwise, 2 pages (0-1)
COLOR FORGRUND%,BAGGRUND%:CLS:KEY OFF
looking that there are GOTO and GOSUBS with line number labels and the KEY OFF command, example code was ported from GWBasic that had line numbers in it and had 25th line displaying functions keys commands (turned off by key off).