Merge branch 'develop' into issue-5446-tlsv1-fix

This commit is contained in:
Zach Bloomquist
2020-01-10 07:26:01 -08:00
committed by GitHub
16 changed files with 163 additions and 35 deletions

View File

@@ -128,13 +128,11 @@ describe('Project Nav', function () {
return b.displayName !== 'Chrome'
})
let family = dropdownBrowsers[i].family
family = family === 'electron' ? 'chrome' : family
let name = dropdownBrowsers[i].name
// first one is shown in selection, so skip first
cy.wrap($i).should('have.class',
`fa-${family}`)
`browser-icon ./fonts/${name}.svg`)
})
})
@@ -150,7 +148,7 @@ describe('Project Nav', function () {
it('displays default browser icon in chosen', () => {
cy.get('.browsers-list>a').first()
.find('.fa-chrome')
.find('.chrome')
})
})
})
@@ -195,8 +193,8 @@ describe('Project Nav', function () {
})
it('displays browser icon as spinner', () => {
cy.get('.browsers-list>a').first().find('i')
.should('have.class', 'fas fa-sync-alt fa-spin')
cy.get('.browsers-list>a').find('img')
.should('have.class', 'browser-icon ./fonts/loading.svg')
})
it('disables browser dropdown', () => {
@@ -213,8 +211,8 @@ describe('Project Nav', function () {
})
it('displays browser icon as opened', () => {
cy.get('.browsers-list>a').first().find('i')
.should('have.class', 'fas fa-check-circle')
cy.get('.browsers-list>a').first().find('img')
.should('have.class', 'browser-icon ./fonts/checkmark.svg')
})
it('disables browser dropdown', () => {
@@ -257,7 +255,7 @@ describe('Project Nav', function () {
it('displays default browser icon', () => {
cy.get('.browsers-list>a').first()
.find('.fa-chrome')
.find('.chrome')
})
})
@@ -277,7 +275,7 @@ describe('Project Nav', function () {
it('displays default browser icon', () => {
cy.get('.browsers-list>a').first()
.find('.fa-chrome')
.find('.chrome')
})
})
})
@@ -301,7 +299,7 @@ describe('Project Nav', function () {
it('displays local storage browser icon in chosen', () => {
cy.get('.browsers-list>a').first()
.find('.fa-chrome')
.find('.chromium')
})
})
@@ -388,6 +386,8 @@ describe('Project Nav', function () {
it('displays generic icon', () => {
cy.get('.browsers-list>a').first()
.should('contain', 'Custom Foo')
.find('.browser-icon').should('have.class',
`browser-icon ./fonts/defaultBrowser.svg`)
})
it('pre-selects the custom browser', () => {

View File

@@ -169,26 +169,20 @@
display: inline-block;
}
.browser-icon {
color: #4573d9;
.browser-icon {
width: 16px;
height: 16px;
}
.chrome > .browser-icon {
color: #1da261;
}
.canary > .browser-icon {
color: #f29b14;
}
.chromium > .browser-icon {
color: #4573d9;
}
.electron > .browser-icon {
color: #2b2e3a;
}
.firefox > .browser-icon {
color: #ff720d;
.selected .browser-icon {
position: relative;
top: -1px;
}
.electron .browser-icon {
position: relative;
top: -1px;
}
.dropdown-menu {
left: auto;
@@ -196,6 +190,7 @@
}
}
.nav .browser-info {
color: #999;
margin-left: 6px;

View File

@@ -49,7 +49,7 @@ class Dropdown extends Component {
_button () {
if (this.props.others.length) {
return (
<a onClick={this._toggleOpen} className={this.props.disabled ? 'disabled' : ''}>
<a onClick={this._toggleOpen} className={`selected ${this.props.disabled ? 'disabled' : ''}`}>
{this._buttonContent()}
</a>
)

View File

@@ -6,6 +6,15 @@ import MarkdownRenderer from '../lib/markdown-renderer'
import projectsApi from '../projects/projects-api'
import electron from './icons/electron.svg'
import chrome from './icons/chrome.svg'
import canary from './icons/canary.svg'
import chromium from './icons/chromium.svg'
import loading from './icons/loading.svg'
import checkmark from './icons/checkmark.svg'
import firefox from './icons/firefox.svg'
import defaultBrowser from './icons/defaultBrowser.svg'
@observer
export default class Browsers extends Component {
render () {
@@ -58,19 +67,42 @@ export default class Browsers extends Component {
let prefixText
if (project.browserState === 'opening') {
icon = 'fas fa-sync-alt fa-spin'
icon = loading
prefixText = 'Opening'
} else if (project.browserState === 'opened') {
icon = 'fas fa-check-circle green far'
icon = checkmark
prefixText = 'Running'
} else {
icon = `fab fa-${browser.icon}`
icon = getIcon(browser.name)
prefixText = ''
}
function getIcon (browserName) {
switch (browserName) {
case 'electron': {
return electron
}
case 'chrome': {
return chrome
}
case 'canary': {
return canary
}
case 'chromium': {
return chromium
}
case 'firefox': {
return firefox
}
default: {
return defaultBrowser
}
}
}
return (
<span className={browser.name}>
<i className={`browser-icon ${icon}`}></i>{' '}
<img src={icon} className={`browser-icon ${icon}`}></img>{' '}
{prefixText}{' '}
{browser.displayName}{' '}
{browser.majorVersion}

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 57 KiB

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 40 512 512" width="15px" height="15px"><path fill="#32BEA6" d="M504.1,256C504.1,119,393,7.9,256,7.9C119,7.9,7.9,119,7.9,256C7.9,393,119,504.1,256,504.1C393,504.1,504.1,393,504.1,256z"/><path fill="#FFF" d="M392.6,172.9c-5.8-15.1-17.7-12.7-30.6-10.1c-7.7,1.6-42,11.6-96.1,68.8c-22.5,23.7-37.3,42.6-47.1,57c-6-7.3-12.8-15.2-20-22.3C176.7,244.2,152,229,151,228.4c-10.3-6.3-23.8-3.1-30.2,7.3c-6.3,10.3-3.1,23.8,7.2,30.2c0.2,0.1,21.4,13.2,39.6,31.5c18.6,18.6,35.5,43.8,35.7,44.1c4.1,6.2,11,9.8,18.3,9.8c1.2,0,2.5-0.1,3.8-0.3c8.6-1.5,15.4-7.9,17.5-16.3c0.1-0.2,8.8-24.3,54.7-72.7c37-39.1,61.7-51.5,70.3-54.9c0.1,0,0.1,0,0.3,0c0,0,0.3-0.1,0.8-0.4c1.5-0.6,2.3-0.8,2.3-0.8c-0.4,0.1-0.6,0.1-0.6,0.1l0-0.1c4-1.7,11.4-4.9,11.5-5C393.3,196.1,397,184.1,392.6,172.9z"/></svg>

After

Width:  |  Height:  |  Size: 811 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="2 3 48 48" width="18px" height="18px"><path fill="#4caf50" d="M44,24c0,11.044-8.956,20-20,20S4,35.044,4,24S12.956,4,24,4S44,12.956,44,24z"/><path fill="#ffc107" d="M24,4v20l8,4l-8.843,16c0.317,0,0.526,0,0.843,0c11.053,0,20-8.947,20-20S35.053,4,24,4z"/><path fill="#4caf50" d="M44,24c0,11.044-8.956,20-20,20S4,35.044,4,24S12.956,4,24,4S44,12.956,44,24z"/><path fill="#ffc107" d="M24,4v20l8,4l-8.843,16c0.317,0,0.526,0,0.843,0c11.053,0,20-8.947,20-20S35.053,4,24,4z"/><path fill="#f44336" d="M41.84,15H24v13l-3-1L7.16,13.26H7.14C10.68,7.69,16.91,4,24,4C31.8,4,38.55,8.48,41.84,15z"/><path fill="#dd2c00" d="M7.158,13.264l8.843,14.862L21,27L7.158,13.264z"/><path fill="#558b2f" d="M23.157,44l8.934-16.059L28,25L23.157,44z"/><path fill="#f9a825" d="M41.865,15H24l-1.579,4.58L41.865,15z"/><path fill="#fff" d="M33,24c0,4.969-4.031,9-9,9s-9-4.031-9-9s4.031-9,9-9S33,19.031,33,24z"/><path fill="#2196f3" d="M31,24c0,3.867-3.133,7-7,7s-7-3.133-7-7s3.133-7,7-7S31,20.133,31,24z"/></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 83 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" width="18px" height="18px"><path fill="#47848f" d="M49.07,32.66c-14.37-2.62-25.72.12-30.25,8-3.38,5.85-2.41,13.61,2.34,21.9a1.47,1.47,0,0,0,2.56-1.47c-4.28-7.47-5.12-14.17-2.35-19,3.76-6.51,13.89-9,27.17-6.54a1.47,1.47,0,1,0,.53-2.9ZM28.63,72.61a92.2,92.2,0,0,0,22,17.34c20.84,12,43,15.25,54,7.79a1.47,1.47,0,0,0-1.66-2.43C93.11,102,72,98.92,52.07,87.39A89.27,89.27,0,0,1,30.81,70.62a1.47,1.47,0,0,0-2.18,2Z"/><path fill="#47848f" d="M101.06,70.81c9.41-11.11,12.69-22.29,8.17-30.11-3.32-5.76-10.35-8.8-19.69-8.92a1.47,1.47,0,0,0,0,2.95c8.4.11,14.45,2.73,17.18,7.45,3.75,6.5.82,16.47-7.87,26.74a1.47,1.47,0,1,0,2.25,1.9ZM76.89,33.15a92,92,0,0,0-26.25,10.4C29.13,56,15.09,74.29,17,87.57A1.47,1.47,0,0,0,20,87.14C18.23,75.35,31.53,58,52.11,46.11A89.07,89.07,0,0,1,77.51,36a1.47,1.47,0,1,0-.62-2.88Z"/><path fill="#47848f" d="M42 96.78C47 110.51 55 119 64.05 119c6.6 0 12.7-4.5 17.46-12.42A1.47 1.47 0 1 0 79 105c-4.28 7.12-9.53 11-14.94 11-7.52 0-14.69-7.54-19.24-20.24a1.47 1.47 0 0 0-2.77 1zM87 94.09a92.5 92.5 0 0 0 3.91-27.3c0-24.41-8.54-45.44-20.71-50.85A1.47 1.47 0 0 0 69 18.64c10.85 4.82 19 24.78 19 48.15a89.57 89.57 0 0 1-3.78 26.42 1.47 1.47 0 0 0 2.81.88zM114.71 92.65a7.05 7.05 0 1 0-7.05 7.05 7.05 7.05 0 0 0 7.05-7.05zm-2.95 0a4.1 4.1 0 1 1-4.1-4.1 4.1 4.1 0 0 1 4.1 4.1zM20.34 99.7a7.05 7.05 0 1 0-7.05-7.05 7.05 7.05 0 0 0 7.05 7.05zm0-2.95a4.1 4.1 0 1 1 4.1-4.1 4.1 4.1 0 0 1-4.1 4.1z"/><path fill="#47848f" d="M64.05 23.13A7.05 7.05 0 1 0 57 16.08a7.05 7.05 0 0 0 7.05 7.05zm0-2.95a4.1 4.1 0 1 1 4.1-4.1 4.1 4.1 0 0 1-4.1 4.1zM65.13 71.77A5.1 5.1 0 1 1 69 65.71 5.1 5.1 0 0 1 65.13 71.77z"/></svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="margin: auto; background: transparent; display: block; shape-rendering: auto;" width="20px" height="20px" viewBox="0 10 100 100" preserveAspectRatio="xMidYMid">
<g transform="rotate(0 50 50)">
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#0a0a0a">
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.9166666666666666s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(30 50 50)">
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#0a0a0a">
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.8333333333333334s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(60 50 50)">
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#0a0a0a">
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.75s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(90 50 50)">
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#0a0a0a">
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.6666666666666666s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(120 50 50)">
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#0a0a0a">
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.5833333333333334s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(150 50 50)">
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#0a0a0a">
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.5s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(180 50 50)">
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#0a0a0a">
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.4166666666666667s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(210 50 50)">
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#0a0a0a">
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.3333333333333333s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(240 50 50)">
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#0a0a0a">
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.25s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(270 50 50)">
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#0a0a0a">
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.16666666666666666s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(300 50 50)">
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#0a0a0a">
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.08333333333333333s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(330 50 50)">
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#0a0a0a">
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="0s" repeatCount="indefinite"></animate>
</rect>
</g>
<!-- [ldio] generated by https://loading.io/ --></svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@@ -284,7 +284,18 @@ const create = function (state, queue, retryFn) {
// assertions
if (cmdHasFunctionArg(cmd)) {
let index = cmd.get('assertionIndex')
const assertions = cmd.get('assertions')
let assertions = cmd.get('assertions')
// https://github.com/cypress-io/cypress/issues/4981
// `assertions` is undefined because assertions added by
// `should` command are not handled yet.
// So, don't increase i and go back to the last command.
if (!assertions) {
i -= 1
cmd = cmds[i - 1]
index = cmd.get('assertionIndex')
assertions = cmd.get('assertions')
}
// always increase the assertionIndex
// so our next assertion matches up

View File

@@ -263,7 +263,8 @@ const shouldUpdateValue = (el: HTMLElement, key: KeyDetails, options) => {
debug('skipping inserting value since number input would be invalid', key.text, potentialValue)
// when typing in a number input, only certain whitelisted chars will insert text
if (!key.text.match(isValidNumberInputChar)) {
options.prevVal = ''
// https://github.com/cypress-io/cypress/issues/6055
// Should not remove old valid values when a new one is not a valid number char, just dismiss it with return
return
}

View File

@@ -1252,6 +1252,13 @@ describe('src/cy/commands/actions/type', () => {
.should('have.value', '-123.12')
})
// https://github.com/cypress-io/cypress/issues/6055
it('can type negative numbers and dismiss invalid characters', () => {
cy.get('#number-without-value')
.type('-a42')
.should('have.value', '-42')
})
it('can type {del}', () => {
cy.get('#number-with-value')
.type('{selectAll}{del}')

View File

@@ -211,6 +211,29 @@ describe('src/cy/commands/assertions', () => {
})
})
it('can be chained', () => {
cy.wrap('ab')
.should((subject) => {
expect(subject).to.be.a('string')
expect(subject).to.contain('a')
})
.should((subject) => {
expect(subject).to.contain('b')
expect(subject).to.have.length(2)
})
.and((subject) => {
expect(subject).to.eq('ab')
expect(subject).not.to.contain('c')
})
.then(function () {
expect(this.logs.length).to.eq(8)
this.logs.slice(1).forEach((log) => {
expect(log.get('name')).to.eq('assert')
})
})
})
context('remote jQuery instances', () => {
beforeEach(function () {
this.remoteWindow = cy.state('window')