This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function waitForSearchResults() { | |
// check if oops page, if oops page, refresh | |
try { | |
return await (await browser.$(selectors.hit)).waitForExist(10000); | |
} catch (e) { | |
// check if it's an oops page | |
if (await isOopsPage()) { | |
// there was an oops page, refresh the page | |
console.error('Oops page, refreshing page....'); | |
await browser.refresh(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { | |
InMemoryCache | |
} = require('apollo-cache-inmemory'); | |
const getQueryName = (query) => { | |
const defs = query.definitions; | |
if (defs && defs.length) { | |
const operationDefinition = defs.filter( | |
({kind}) => kind === 'OperationDefinition' | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { DocumentNode } from "graphql"; | |
interface Query<TVariables> { | |
/* The GraphQL query shape to be used constructed using the `gql` template | |
* string tag from `graphql-tag`. The query will be used to determine the | |
* shape of the data to be read.*/ | |
query: DocumentNode; | |
/** | |
* Any variables that the GraphQL query may depend on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface ApolloCache<TSerialized> { | |
/********************************************************** | |
* Core API | |
*********************************************************/ | |
/** | |
* Returns the cached results for a query if present | |
* @param query read options | |
*/ | |
read<TResult, TVariables>(query: ReadOptions<TVariables>): TResult | null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CodeBuild: | |
Type: 'AWS::CodeBuild::Project' | |
Properties: | |
Name: !Sub ${AWS::StackName}-CodeBuild | |
ServiceRole: !GetAtt CodeBuildRole.Arn | |
Artifacts: | |
# The downloaded source code for the build will come from CodePipeline | |
Type: CODEPIPELINE | |
Name: MyProject | |
Source: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: 2010-09-09 | |
Resources: | |
DeployBucket: | |
Type: 'AWS::S3::Bucket' | |
Properties: | |
# Technically we don't need the S3 bucket configured | |
# as a website, but I included it for the sake of completion. | |
WebsiteConfiguration: | |
IndexDocument: index.html | |
Distribution: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 0.1 | |
phases: | |
pre_build: | |
commands: | |
- echo Installing source NPM dependencies... | |
- npm install | |
build: | |
commands: | |
- echo Build started on `date` | |
- npm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CodePipeline: | |
Type: 'AWS::CodePipeline::Pipeline' | |
Properties: | |
RoleArn: !GetAtt CodePipeLineRole.Arn | |
ArtifactStore: | |
Location: !Ref PipelineBucket | |
Type: S3 | |
Stages: | |
- | |
Name: Source |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Parameters: | |
GithubOwner: | |
Type: String | |
Default: qswitcher | |
Description: "Github repo owner" | |
GithubRepo: | |
Type: String | |
Default: my-test-app | |
Description: "Github repo name" | |
GithubOAuthToken: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: 2010-09-09 | |
Parameters: | |
ProjectSource: | |
Type: String | |
Default: "https://github.com/qswitcher/imgterest" | |
Description: "Source control URL (e.g. Github)" | |
GithubOwner: | |
Type: String | |
Default: qswitcher | |
GithubRepo: |
NewerOlder