Skip to content

Commit

Permalink
Merge branch 'develop' into #49-move-userland-ext
Browse files Browse the repository at this point in the history
  • Loading branch information
jennifer-shehane committed Sep 13, 2017
2 parents 8b472de + 21c0386 commit b1b080c
Show file tree
Hide file tree
Showing 8 changed files with 466 additions and 209 deletions.
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ npm start

Visit [http://localhost:2222/](http://localhost:2222/).

**note** If you need to debug documentation build step run with environment
variable set `DEBUG=docs npm run build`

## Writing Documentation

### Adding Examples
Expand Down
17 changes: 15 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,14 @@ jobs:
- run:
name: Waiting for local server to start
command: $(npm bin)/wait-on http://localhost:2222 --interval 1000 --timeout 90000
- run: npm run cypress
- run:
name: Running Cypress tests
command: |
if [ -n "$DOCS_RECORD_KEY" ]; then
$(npm bin)/cypress run --record --key $DOCS_RECORD_KEY
else
$(npm bin)/cypress run
fi
"deploy-docs-staging":
<<: *defaults
Expand All @@ -91,7 +98,13 @@ jobs:
command: cat public/build.json
- run:
name: Test deployed docs
command: CYPRESS_baseUrl=https://docs-staging.cypress.io npm run cypress
command: |
export CYPRESS_baseUrl=https://docs-staging.cypress.io
if [ -n "$DOCS_RECORD_KEY" ]; then
$(npm bin)/cypress run --record --key $DOCS_RECORD_KEY
else
$(npm bin)/cypress run
fi
"deploy-docs-production":
<<: *defaults
Expand Down
33 changes: 33 additions & 0 deletions cypress/integration/main_spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,39 @@ describe "Documentation", ->
beforeEach ->
cy.server()

context "CSS", ->
beforeEach ->
cy.visit("/")
# wait for the page redirect and load
cy.url().should('contain', 'why-cypress')

# only works in development environment where each CSS
# file is separate
if Cypress.config('baseUrl').includes('localhost')
it "loads fira", ->
cy.request("fonts/vendor/fira/fira.css")

it "has limited container height", ->
cy.get('#container')
.then (el) ->
elHeight = getComputedStyle(el[0]).height
viewportHeight = Cypress.config('viewportHeight')
expect(elHeight).to.equal(viewportHeight + 'px')

it "has app CSS style rules", ->
isAppStyle = (ruleList) ->
ruleList.href.includes('/cypress.css') || # local separate CSS files
ruleList.href.includes('/style') # single bundle in production

cy.document()
.then (doc) ->
appRules = Cypress._.find(doc.styleSheets, isAppStyle)
expect(appRules, 'app rules are loaded').to.not.be.undefined
cy.log('found App style rules')
containerRules = Cypress._.find(appRules.rules, {selectorText: '#container'})
expect(containerRules, 'has #container CSS').to.not.be.undefined
cy.log('found CSS rules for', containerRules.selectorText)

context "Pages", ->
describe "404", ->
it "displays", ->
Expand Down
3 changes: 2 additions & 1 deletion lib/url_generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const request = require('request-promise')
const errors = require('request-promise/errors')
const la = require('lazy-ass')
const is = require('check-more-types')
const debug = require('debug')('docs')

const startsWithHttpRe = /^http/
const everythingAfterHashRe = /(#.+)/
Expand Down Expand Up @@ -252,7 +253,7 @@ function validateAndGetUrl (sidebar, href, source, text, render) {
return Promise.resolve(cachedValue)
}

console.log('requesting href', href)
debug('requesting href', href)

if (isExternalHref(href)) {
// cache this now even though
Expand Down
Loading

0 comments on commit b1b080c

Please sign in to comment.